SyncProperty: allow priorities, set source name
This commit is contained in:
parent
85651a241a
commit
0735ed0aa1
|
@ -28,11 +28,19 @@ class SyncProperty extends DbObject
|
||||||
|
|
||||||
protected function beforeStore()
|
protected function beforeStore()
|
||||||
{
|
{
|
||||||
if (! $this->hasBeenLoadedFromDb()) {
|
if (! $this->hasBeenLoadedFromDb() && $this->get('priority') === null) {
|
||||||
$this->setNextPriority('rule_id');
|
$this->setNextPriority('rule_id');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setSource($name)
|
||||||
|
{
|
||||||
|
$source = ImportSource::loadByName($name, $this->getConnection());
|
||||||
|
$this->set('source_id', $source->get('id'));
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
protected function onInsert()
|
protected function onInsert()
|
||||||
{
|
{
|
||||||
$this->refreshPriortyProperty();
|
$this->refreshPriortyProperty();
|
||||||
|
|
Loading…
Reference in New Issue