for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Leonidas\Library\System\Model\Post\Abstracts;
use Leonidas\Contracts\System\Model\Category\CategoryCollectionInterface;
use Leonidas\Contracts\System\Model\Category\CategoryInterface;
use Leonidas\Contracts\System\Model\Post\Status\PostStatusInterface;
use Leonidas\Contracts\System\Model\Tag\TagCollectionInterface;
use Leonidas\Contracts\System\Model\Tag\TagInterface;
trait MutablePostTrait
{
use PostTrait;
public function setExcerpt(string $excerpt): self
$this->post->post_excerpt = $excerpt;
return $this;
}
public function setStatus(PostStatusInterface $status): self
$this->post->post_status = $status->getName();
public function setCategories(CategoryCollectionInterface $categories): self
$this->categories = $categories;
public function addCategories(CategoryInterface ...$categories): self
$this->getCategories()->collect(...$categories);
public function mergeCategories(CategoryCollectionInterface $categories): self
$this->getCategories()->collect(...$categories->values());
public function setTags(TagCollectionInterface $tags): self
$this->tags = $tags;
public function addTags(TagInterface ...$tags): self
$this->getTags()->collect(...$tags);
public function mergeTags(TagCollectionInterface $tags): self
$this->getTags()->collect(...$tags->values());