Newscoop\EventDispatcher\Events\CollectObjectsDataEvent::registerObjectTypes PHP Method

registerObjectTypes() public method

Add object type registration data
public registerObjectTypes ( array $name, array $objectType )
$name array
$objectType array
    public function registerObjectTypes($name, array $objectType)
    {
        $this->objectTypes[$name] = $objectType;
    }

Usage Example

 /**
  * Register plugin list objects in Newscoop
  *
  * @param  CollectObjectsDataEvent $event
  */
 public function registerObjects(CollectObjectsDataEvent $event)
 {
     $event->registerListObject('ahs\\advertspluginbundle\\templatelist\\announcements', array('class' => 'AHS\\AdvertsPluginBundle\\TemplateList\\Announcements', 'list' => 'announcements', 'url_id' => 'ann'));
     $event->registerObjectTypes('announcement', array('class' => '\\AHS\\AdvertsPluginBundle\\Entity\\Announcement'));
     $event->registerListObject('ahs\\advertspluginbundle\\templatelist\\categories', array('class' => 'AHS\\AdvertsPluginBundle\\TemplateList\\Categories', 'list' => 'categories', 'url_id' => 'ctgr'));
     $event->registerObjectTypes('anouncements_category', array('class' => '\\AHS\\AdvertsPluginBundle\\Entity\\Category'));
 }
All Usage Examples Of Newscoop\EventDispatcher\Events\CollectObjectsDataEvent::registerObjectTypes