Content Collection

If you want to retrieve a dummie Content Collection:

<span class="comments">/** @var \Blackbird\ContentManager\Model\ResourceModel\ContentType\CollectionFactory $contentCollectionFactory */</span>
<span class="variable">$contentCollection</span> = <span class="variable">$contentCollectionFactory</span>->create();

or

<span class="comments">/** @var \Blackbird\ContentManager\Model\Content $contentModel */</span>
<span class="variable">$contentCollection</span> = <span class="variable">$contentModel</span>->getCollection();

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

<span class="comments">/** @var \Blackbird\ContentManager\Model\ResourceModel\ContentType\CollectionFactory $contentCollectionFactory */</span>
<span class="variable">$contentCollection</span> = <span class="variable">$contentCollectionFactory</span>->create()->addContentTypeFilter(<span class="variable">$contentType</span>);

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

or

<span class="comments">/** @var \Blackbird\ContentManager\Model\ContentType $contentType */</span>
<span class="variable">$contentCollection</span> = <span class="variable">$contentType</span>->load(<span class="variable">$contentTypeId</span>)->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.

Chargement en cours...