Esempio n. 1
0
 public function getValue($name)
 {
     switch ($name) {
         case 'Data':
         case 'SummaryData':
         case 'JsonTranslation':
             return array('ID' => $this->ID, 'Class' => $this->Class, 'ContextClass' => $this->ContextClass, 'ContextID' => $this->ContextID, 'MIMEType' => $this->MIMEType, 'Width' => $this->Width, 'Height' => $this->Height, 'Duration' => $this->Duration);
         case 'Filename':
             return $this->getFilename();
         case 'ThumbnailMIMEType':
             return $this->MIMEType;
         case 'Extension':
             throw new MediaTypeException('Unable to find extension for mime-type: ' . $this->MIMEType);
         case 'WebPath':
             if (!isset($this->_webPath)) {
                 $this->_webPath = sprintf(static::$webPathFormat, $this->ID);
             }
             return $this->_webPath;
         case 'FilesystemPath':
             return $this->getFilesystemPath();
         case 'BlankPath':
             return static::getBlankPath($this->ContextClass);
         default:
             return parent::getValue($name);
     }
 }
Esempio n. 2
0
 public function getValue($name)
 {
     switch ($name) {
         case 'CountryFull':
             return $this->Country ? static::$countries[$this->Country] : '';
         default:
             return parent::getValue($name);
     }
 }
Esempio n. 3
0
 public function getValue($name)
 {
     switch ($name) {
         case 'Items':
             return $this->getItems();
         default:
             return parent::getValue($name);
     }
 }
Esempio n. 4
0
 public function getValue($name)
 {
     switch ($name) {
         case 'isExpired':
             return $this->Expires < time();
         case 'isUsed':
             return $this->Used == true;
         default:
             return parent::getValue($name);
     }
 }
Esempio n. 5
0
 public function getValue($name)
 {
     switch ($name) {
         case 'Prefix':
             return preg_replace('/\\..*$/', '', $this->Title);
         case 'UnprefixedTitle':
             return preg_replace('/^[^.]+\\.\\s*/', '', $this->Title);
         case 'HandlePrefix':
             return preg_replace('/\\..*$/', '', $this->Handle);
         case 'UnprefixedHandle':
             return preg_replace('/^[^.]+\\.\\s*/', '', $this->Handle);
         default:
             return parent::getValue($name);
     }
 }