diff --git a/library/Director/Objects/SyncProperty.php b/library/Director/Objects/SyncProperty.php index c65bcc24..20c47005 100644 --- a/library/Director/Objects/SyncProperty.php +++ b/library/Director/Objects/SyncProperty.php @@ -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();