Skip to content

Version 1.1.0 - Stable

Compare
Choose a tag to compare
@phproberto phproberto released this 19 Jun 11:45

Bug fixes

  • Retrieving images for not-loaded entities could cause invalid queries. Thanks @jatitoam. (#10)
$article = new Article;

// This was throwing an exception because article is not loaded
$images = $article->getImages();

New Features

  • Field system improvements:
    • Allow to retrieve field name from field entity. Thanks @jatitoam. (#10)
    • Allow to retrieve field value & raw value from field entity. Thanks @jatitoam. (#10)
// New function to retrieve a field by its name
$yearField = $article->fieldByName('year');

// Check if a field has a value assigned an retrieve it
if ($yearField->hasValue() && $yearField->value() === '2018')
{
    echo 'This article is from year 2018';
}
  • Collection::filter(): function to create retrieve a subset of a collection.
// Use a function to retrieve only articles of category 23
$categoryArticles = $articles->filter(
    function ($article)
    {
        return 23 === (int) $article->get('catid');
    }
);
  • Allow to retrieve entity fields by their name.

Downloads