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()
|
||||
{
|
||||
if (! $this->hasBeenLoadedFromDb()) {
|
||||
if (! $this->hasBeenLoadedFromDb() && $this->get('priority') === null) {
|
||||
$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()
|
||||
{
|
||||
$this->refreshPriortyProperty();
|
||||
|
|
Loading…
Reference in New Issue