Example #1
0
 public function attach(EventManagerInterface $events)
 {
     parent::attach($events);
     $events->attach(Collection::EVENT_AFTER_UPDATE, [$this, 'afterUpdate']);
     $events->attach(Collection::EVENT_AFTER_CREATE, [$this, 'afterCreate']);
     $events->attach(Collection::EVENT_BEFORE_CREATE, [$this, 'beforeCreate']);
     $events->attach(Collection::EVENT_AFTER_DELETE, [$this, 'afterDelete']);
 }
Example #2
0
 /**
  * @param $name
  * @param array|null $config
  * @return Entity|\Platform\Type
  */
 public function makeType($name, array $config = null)
 {
     $type = new Entity();
     $type->setEntityType($name);
     if ($config) {
         $type = $this->configureType($type, $config);
     }
     return $type;
 }