本文整理汇总了PHP中AppModel::get方法的典型用法代码示例。如果您正苦于以下问题:PHP AppModel::get方法的具体用法?PHP AppModel::get怎么用?PHP AppModel::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppModel
的用法示例。
在下文中一共展示了AppModel::get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: retrieveItem
protected function retrieveItem(AppModel $object, $parameter_not_found = MESSAGE_PARAMETER_NOT_FOUND, $parameter_not_valid = MESSAGE_PARAMETER_NOT_VALID, $record_not_found = MESSAGE_RECORD_NOT_FOUND)
{
if (count($this->registry->request['args']) <= 0) {
$this->error_500(array("error_string" => $parameter_not_found));
}
$id = intval($this->registry->request['args']['0']);
if ($id == 0) {
$this->error_500(array("error_string" => $parameter_not_valid));
}
$item = $object->get($id);
if ($item == null) {
$this->error_500(array("error_string" => $record_not_found));
}
return $item;
}
示例2: get
/**
* estrare un singolo record dalla tabella
* @param id
* @return item or null
*/
public function get($id){
$item = parent::get($id);
$sys_userrole = new sys_userrole($this -> _db);
$item_role = $sys_userrole -> get($item-> sys_userrole_fk);
$item -> role_label = $item_role -> name;
$item -> role_desc = $item_role -> description;
intval($item -> blocked) == 0 ? $item -> blocked_label = "No" : $item -> blocked_label = "Si";
intval($item -> sendemail) == 0 ? $item -> sendemail_label = "No" : $item -> sendemail_label = "Si";
$date = DateTime::createFromFormat("Y-m-d H:i:s", $item -> registerdate);
$item -> registerdate = $date -> format("d/m/Y");
return $item;
}