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']); }
/** * @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; }