Ejemplo n.º 1
0
 /**
  * @param array $types
  *
  * @return StorageEntity[]
  */
 public function getList(array $types = [])
 {
     if (!$types || $types == StorageEntity::getTypes()) {
         return $this->getEntityManager()->createQuery('
             SELECT
                 s
             FROM
                 AnimeDbCatalogBundle:Storage s
             ORDER BY
                 s.id DESC
         ')->getResult();
     }
     return $this->getEntityManager()->createQuery('
         SELECT
             s
         FROM
             AnimeDbCatalogBundle:Storage s
         WHERE
             s.type IN (:types)
         ORDER BY
             s.id DESC
     ')->setParameter(':types', $types)->getResult();
 }
Ejemplo n.º 2
0
 public function testGetTypes()
 {
     $this->assertEquals([Storage::TYPE_FOLDER, Storage::TYPE_EXTERNAL, Storage::TYPE_EXTERNAL_R, Storage::TYPE_VIDEO], Storage::getTypes());
 }