<?php
namespace App\Repository;

use Doctrine\ORM\EntityRepository;

/**
 * Repository for workspaces
 */
class ActorRepository extends EntityRepository
{

    /** @var array Default sorting */
    public const DEFAULT_ORDER = [
        'firstName' => 'asc',
        'lastName' => 'asc'
    ];

    public function findAll($onlyActive = false): array
    {
        $critera = [];
        if ($onlyActive) {
            $critera['active'] = True;
        }
        return $this->findBy($critera, ActorRepository::DEFAULT_ORDER);
    }
}