SyncProperty: add source column helper methods

This commit is contained in:
Thomas Gelf 2015-11-06 09:50:06 +01:00
parent d23149bf3e
commit 86b613eb55
1 changed files with 14 additions and 0 deletions

View File

@ -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;
}
}