SyncProperty: add source column helper methods
This commit is contained in:
parent
d23149bf3e
commit
86b613eb55
|
@ -28,4 +28,18 @@ class SyncProperty extends DbObject
|
|||
$this->source_expression = '${' . $value . '}';
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function sourceIsSingleColumn()
|
||||
{
|
||||
return $this->getSourceColumn() !== null;
|
||||
}
|
||||
|
||||
public function getSourceColumn()
|
||||
{
|
||||
if (preg_match('/^\${([A-Za-z0-9_-]+)}$/', $this->source_expression, $m)) {
|
||||
return $m[1];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue