Ejemplo n.º 1
0
Archivo: Image.php Proyecto: vsguts/crm
 public function init()
 {
     parent::init();
     $this->on(ActiveRecord::EVENT_BEFORE_INSERT, [$this, 'attachImageEvent']);
     $this->on(ActiveRecord::EVENT_BEFORE_INSERT, [$this, 'updateDefaultsEvent']);
     $this->on(ActiveRecord::EVENT_BEFORE_UPDATE, [$this, 'updateDefaultsEvent']);
     $this->on(ActiveRecord::EVENT_AFTER_INSERT, [$this, 'updateDefaultsPostEvent']);
     $this->on(ActiveRecord::EVENT_AFTER_UPDATE, [$this, 'updateDefaultsPostEvent']);
     $this->on(ActiveRecord::EVENT_BEFORE_DELETE, [$this, 'detachImageEvent']);
 }
Ejemplo n.º 2
0
 public function init()
 {
     parent::init();
     $this->on(ActiveRecord::EVENT_BEFORE_INSERT, [$this, 'attachEvent']);
     $this->on(ActiveRecord::EVENT_BEFORE_DELETE, [$this, 'detachEvent']);
 }