public function preInsert(IPF_ORM_Event $event)
{
- $this->setOrderValue($event->getInvoker());
+ $this->setOwner($event->getInvoker());
}
public function preUpdate(IPF_ORM_Event $event)
{
- $this->setOrderValue($event->getInvoker());
+ $this->setOwner($event->getInvoker());
}
- private function setOrderValue($obj)
+ private function setOwner($obj)
{
$columnName = $this->columnName;
if ($obj->$columnName)
{
$this->hasColumn($this->columnName, 'integer', null, array(
'exclude' => $this->exclude,
- 'notblank' => true,
- 'notnull' => true,
'verbose' => $this->verbose,
));
- $this->hasOne('User as '.$this->name, array('local' => $this->columnName, 'foreign' => 'id', 'onDelete' => 'CASCADE'));
+ $this->hasOne('User as '.$this->name, array(
+ 'local' => $this->columnName,
+ 'exclude' => $this->exclude,
+ 'foreign' => 'id',
+ 'onDelete' => 'CASCADE',
+ ));
$this->getTable()->listeners['Owned_'.$this->columnName] = new IPF_ORM_Template_Listener_Owned($this->columnName);
}
}