本文整理汇总了PHP中ActiveRecordModel::deleteById方法的典型用法代码示例。如果您正苦于以下问题:PHP ActiveRecordModel::deleteById方法的具体用法?PHP ActiveRecordModel::deleteById怎么用?PHP ActiveRecordModel::deleteById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActiveRecordModel
的用法示例。
在下文中一共展示了ActiveRecordModel::deleteById方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
/**
* Remove a news entry
*
* @role delete
* @return JSONResponse
*/
public function delete()
{
try {
ActiveRecordModel::deleteById('ProductRatingType', $this->request->get('id'));
return new JSONResponse(false, 'success');
} catch (Exception $exc) {
return new JSONResponse(false, 'failure', $this->translate('_could_not_remove_rating_type'));
}
}
示例2: delete
/**
* Delete field group from database
*
* @return JSONResponse Status
*/
public function delete()
{
if ($id = $this->request->get("id", false)) {
ActiveRecordModel::deleteById($this->getClassName(), $id);
return new JSONResponse(false, 'success');
} else {
return new JSONResponse(false, 'failure', $this->translate('_could_not_remove_specfield_group'));
}
}
示例3: delete
/**
* Delete field value from database
*
* @return JSONResponse Indicates status
*/
public function delete()
{
if ($id = $this->request->get('id', false)) {
ActiveRecordModel::deleteById($this->getClassName(), $id);
return new JSONResponse(false, 'success');
} else {
return new JSONResponse(false, 'failure');
}
}
示例4: delete
/**
* Delete specification field from database
*
* @return JSONResponse
*/
public function delete()
{
$id = $this->request->get("id", false);
if (ActiveRecordModel::objectExists($this->getFieldClass(), $id)) {
ActiveRecordModel::deleteById($this->getFieldClass(), $id);
return new JSONResponse(false, 'success');
} else {
return new JSONResponse(false, 'failure', $this->translate('_could_not_remove_attribute'));
}
}