Content Collection

If you want to retrieve a dummie Content Collection:


  /** @var \Blackbird\ContentManager\Model\ResourceModel\ContentType\CollectionFactory $contentCollectionFactory */
  $contentCollection = $contentCollectionFactory->create();

or


  /** @var \Blackbird\ContentManager\Model\Content $contentModel */
  $contentCollection = $contentModel->getCollection();

If you want to retrieve a Content Collection from a specific Content Type:


  /** @var \Blackbird\ContentManager\Model\ResourceModel\ContentType\CollectionFactory $contentCollectionFactory */
  $contentCollection = $contentCollectionFactory->create()->addContentTypeFilter($contentType);

where $contentType can be string|int|\Blackbird\ContentManager\Model\ResourceModel\Content\ContentType


or


  /** @var \Blackbird\ContentManager\Model\ContentType $contentType */
  $contentCollection = $contentType->load($contentTypeId)->getContentCollection();

where $contentTypeId is the content type ID. In fact you should call the getContentCollection() on a instantiate and existing content type, not on a empty content type object.

loader
Chargement en cours...