本文整理汇总了PHP中ActiveRecord::getValue方法的典型用法代码示例。如果您正苦于以下问题:PHP ActiveRecord::getValue方法的具体用法?PHP ActiveRecord::getValue怎么用?PHP ActiveRecord::getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActiveRecord
的用法示例。
在下文中一共展示了ActiveRecord::getValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getValue
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);
}
}
示例2: getValue
public function getValue($name)
{
switch ($name) {
case 'CountryFull':
return $this->Country ? static::$countries[$this->Country] : '';
default:
return parent::getValue($name);
}
}
示例3: getValue
public function getValue($name)
{
switch ($name) {
case 'Items':
return $this->getItems();
default:
return parent::getValue($name);
}
}
示例4: getValue
public function getValue($name)
{
switch ($name) {
case 'isExpired':
return $this->Expires < time();
case 'isUsed':
return $this->Used == true;
default:
return parent::getValue($name);
}
}
示例5: getValue
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);
}
}