本文整理汇总了PHP中ActiveRecordModel::getID方法的典型用法代码示例。如果您正苦于以下问题:PHP ActiveRecordModel::getID方法的具体用法?PHP ActiveRecordModel::getID怎么用?PHP ActiveRecordModel::getID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActiveRecordModel
的用法示例。
在下文中一共展示了ActiveRecordModel::getID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: restoreInstance
public static function restoreInstance($className, ActiveRecordModel $owner, EavFieldCommon $field, $value)
{
$specItem = parent::getInstanceByID($className, array(call_user_func(array($className, 'getOwnerIDColumnName')) => $owner->getID(), call_user_func(array($className, 'getFieldIDColumnName')) => $field->getID()));
$specItem->value->set($value);
$specItem->resetModifiedStatus();
return $specItem;
}
示例2: __construct
public function __construct(ActiveRecordModel $owner, $specificationDataArray = null)
{
$this->owner = $owner;
if (is_null($specificationDataArray) && $owner->getID()) {
$specificationDataArray = self::fetchRawSpecificationData(get_class($this), array($owner->getID()), true);
$groupClass = $this->getFieldClass() . 'Group';
$groupIDColumn = strtolower(substr($groupClass, 0, 1)) . substr($groupClass, 1) . 'ID';
// preload attribute groups
$groups = array();
foreach ($specificationDataArray as $spec) {
if ($spec[$groupIDColumn]) {
$groups[$spec[$groupIDColumn]] = true;
}
}
$groups = array_keys($groups);
ActiveRecordModel::getInstanceArray($groupClass, $groups);
}
$this->loadSpecificationData($specificationDataArray);
}
示例3: save
protected function save(ActiveRecordModel $listGroup)
{
$validator = $this->buildValidator();
if ($validator->isValid()) {
$listGroup->loadRequestData($this->request);
$listGroup->save();
return new JSONResponse(array('ID' => $listGroup->getID(), 'data' => $listGroup->toArray()), 'success');
} else {
return new JSONResponse(array('errors' => $validator->getErrorList()), 'failure');
}
}