Example #1
0
 /**
  * Set getter by name
  * 
  * @param string $name The set filename
  * @return Smak\Portfolio\Set | null
  */
 public function getByName($name)
 {
     parent::getByName($name);
     foreach ($this->getIterator() as $file_info) {
         if ($name == $file_info->getFilename()) {
             return new Set($file_info);
         }
     }
 }
Example #2
0
File: Set.php Project: eexit/smak
 /**
  * Photo getter by name (filename without extension)
  * 
  * @param string $name The photo filename (w/o extension)
  * @return Smak\Portfolio\Photo | null
  */
 public function getByName($name)
 {
     parent::getByName($name);
     foreach ($this->getAll() as $photo) {
         foreach ($this->allowed_ext as $ext) {
             if ($name === $photo->getBasename($ext)) {
                 return $photo;
             }
         }
     }
 }