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

registerListObject() public method

Add list objects registration data
public registerListObject ( array $name, array $listObject )
$name array
$listObject array
    public function registerListObject($name, array $listObject)
    {
        $this->listObjects[$name] = $listObject;
    }

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::registerListObject