<?php
namespace App\Entity\Filesystem;
use App\Entity\Shared\UlidIdentifiableInterface;
use App\Entity\Shared\UlidIdentifiableTrait;
use Cms\CoreBundle\Model\Interfaces\Blameable\BlameableInterface;
use Cms\CoreBundle\Model\Interfaces\Blameable\BlameableTrait;
use Cms\CoreBundle\Model\Interfaces\Timestampable\TimestampableInterface;
use Cms\CoreBundle\Model\Interfaces\Timestampable\TimestampableTrait;
use Cms\TenantBundle\Model\TenantableInterface;
use Cms\TenantBundle\Model\TenantableTrait;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(
* repositoryClass = "App\Doctrine\Repository\Filesystem\LooseFolderRepository",
* )
* @ORM\Table(
* name = "sys__filesystem__temp_folder",
* )
*/
class LooseFolder
implements
UlidIdentifiableInterface,
TenantableInterface,
TimestampableInterface,
BlameableInterface
{
use UlidIdentifiableTrait;
use TenantableTrait;
use TimestampableTrait;
use BlameableTrait;
/**
* @var ArrayCollection|LooseFile[]
*
* @ORM\OneToMany(
* targetEntity = "App\Entity\Filesystem\LooseFile",
* mappedBy = "folder",
* )
* @ORM\OrderBy({
* "name" = "ASC",
* })
*/
protected $files;
/**
*
*/
public function __construct()
{
$this->files = new ArrayCollection();
}
/**
* @param Criteria|null $criteria
* @return iterable|Collection|ArrayCollection
*/
public function getFiles(?Criteria $criteria = null): iterable
{
if ( ! $this->files instanceof Collection) {
$this->files = new ArrayCollection();
}
if ( ! empty($criteria)) {
return $this->files->matching($criteria);
}
return $this->files;
}
}