<?php

namespace ArcaSolutions\WebBundle\Repository;

use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\EntityRepository;


/**
 * SliderRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class SliderRepository extends EntityRepository
{
    /**
     * Description
     *
     * @param bool $count
     *
     * @return array|null
     */
    public function getSliders($count = false)
    {
        $matching = $this->matching(
            Criteria::create()->where(Criteria::expr()->neq('imageId', 0))
        );

        if ($count) {
            return $matching->count();
        }

        return $matching;
    }
}
