/** * Get Field By Name * * @param $name * @throws FieldNotFoundException * * @return null */ public function getFieldByName($name) { $field = null; foreach ($this->fields as $fieldEntry) { if ($field->getName() == $name) { $field = $fieldEntry; } } if (null != $field) { return $field; } throw new FieldNotFoundException(spritf("the field %s does not exist", $name), 401); }
/** * Removes all temporary files */ private function unlinkFiles() { unlink(sprintf("%s_o.mp3", $this->file)); unlink(sprintf("%s_2.mp3", $this->file)); unlink($this->file); if (!$this->stereo) { unlink(sprintf("%s.wav", $this->file)); } else { unlink(spritf("%s_l.wav", $this->file)); unlink(spritf("%s_r.wav", $this->file)); } }