本文整理汇总了PHP中Ak::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Ak::get方法的具体用法?PHP Ak::get怎么用?PHP Ak::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ak
的用法示例。
在下文中一共展示了Ak::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getModelAttributesForViews
private function _getModelAttributesForViews()
{
$attributes = array();
$ModelInstance = Ak::get($this->class_name);
if ($ModelInstance instanceof $this->class_name) {
$table_name = $ModelInstance->getTableName();
if (!empty($table_name)) {
$attributes = $ModelInstance->getContentColumns();
unset($attributes['updated_at'], $attributes['updated_on'], $attributes['created_at'], $attributes['created_on']);
}
$internationalized_columns = $ModelInstance->getInternationalizedColumns();
foreach ($internationalized_columns as $column_name => $languages) {
foreach ($languages as $lang) {
$attributes[$column_name] = $attributes[$lang . '_' . $column_name];
$attributes[$column_name]['name'] = $column_name;
unset($attributes[$lang . '_' . $column_name]);
}
}
}
$helper_methods = array('string' => 'text_field', 'text' => 'text_area', 'date' => 'text_field', 'datetime' => 'text_field');
foreach ($attributes as $k => $v) {
$attributes[$k]['type'] = $helper_methods[$attributes[$k]['type']];
}
return $attributes;
}
示例2: setObservedModels
/**
* Constructs the Observer
* @param $subject the name or names of the Models to observe
*/
public function setObservedModels()
{
$args = func_get_args();
$models = func_num_args() == 1 ? is_array($args[0]) ? $args[0] : array($args[0]) : $args;
foreach ($models as $class_name) {
$Object = Ak::get($class_name);
$this->observe($Object);
}
}
示例3: __getFailOver
protected function __getFailOver($name)
{
$this->{$name} = Ak::get($name);
return $this->{$name} instanceof AkBaseModel;
}