本文整理汇总了PHP中ActiveRecord::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP ActiveRecord::delete方法的具体用法?PHP ActiveRecord::delete怎么用?PHP ActiveRecord::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActiveRecord
的用法示例。
在下文中一共展示了ActiveRecord::delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
public function delete()
{
Context::get('db')->start_transaction();
// delete blog comment
BlogComment::neo()->where('blog_id = ?', $this->id)->delete();
// delete blog
parent::delete();
Context::get('db')->commit();
}
示例2: removeAssociatedRecord
public function removeAssociatedRecord(ActiveRecord $Record)
{
$associatedRecord =& $Record->getRecord();
$associatedRecord[$this->_Association->getDefinition('foreignKey')] = null;
if ($this->_Association->getDefinition('deleteWhenNotAssociated')) {
$Record->delete(true);
} else {
$Record->setChanged();
}
}
示例3: delete
public function delete()
{
parent::delete();
@unlink($this->getFilePath(true));
@unlink($this->getFilePath(true) . '.' . $this->getSuffix());
// We must update any definitions holding this signature
$definitions = srCertificateDefinition::where(array('signature_id' => $this->getId()))->get();
foreach ($definitions as $definition) {
/** @var srCertificateDefinition $definition */
$definition->setSignatureId(0);
$definition->update();
}
}
示例4: delete_file
public function delete_file($id)
{
$rs = false;
$File = new ActiveRecord('uploads');
if ($File->find($id)) {
$subfolder = $File->fields['folder'] != '' ? $File->fields['folder'] . '/' : '';
$path = $File->fields['ruta'] . $subfolder . $File->fields['archivo'];
$File->delete();
if (@unlink($path)) {
$rs = true;
}
}
return $rs;
}
示例5: Eliminar
public function Eliminar()
{
$db = new db();
$db->connect();
$C = new ActiveRecord('fk_perfiles');
$C->fields['id_perfil'] = $this->id_perfil;
$C->delete();
$db->close();
}
示例6: delete
/**
* Cascade deletion to children.
*/
public function delete($delete_id = null)
{
parent::delete($delete_id);
$this->constituent_schools()->delete($this->delete_id);
}
示例7: ActiveRecord
require_once 'activerecord.php';
$ar = new ActiveRecord();
$ar->connectPdo('blogdb', 'blog', $_POST['username'], $_POST['password']);
$postid = $ar->size() + 1;
$ar->pagenum = $postid;
$ar->author = $_POST['username'];
$ar->date = date('Y/m/d');
$ar->title = $_POST['title'];
$ar->text = nl2br($_POST['text']);
try {
$ar->save();
} catch (Exception $e) {
echo $e->getMessage();
return;
}
$ar->connectPdo('blogdb', 'categorytable', $_POST['username'], $_POST['password']);
$categories = explode(',', $_POST["category"]);
foreach ($categories as $category) {
$ar->postid = $postid;
$ar->category = $category;
try {
$ar->save();
} catch (Exception $e) {
echo $e->getMessage();
$ar->connectPdo('blogdb', 'blog', $_POST['username'], $_POST['password']);
$postid = $ar->size();
$ar->delete($postid);
return;
}
}
echo "{$postid}番目の記事を投稿しました";
示例8: delete
public function delete()
{
foreach ($this->getUdfCheckObjects() as $udf_check) {
$udf_check->delete();
}
parent::delete();
}
示例9: deleteLine
private function deleteLine()
{
$tableId = fk_post('tId');
$id = fk_post($tableId . '_recId-' . fk_post('recIdToDel'));
if ($id > 0) {
$Ar = new ActiveRecord($this->table_name);
$Ar->find($id);
$Ar->delete();
}
}
示例10: ActiveRecord
<?php
require_once 'activerecord.php';
$ar = new ActiveRecord();
$ar->connectPdo('blogdb', 'blog', $_POST['username'], $_POST['password']);
$ar->delete($_POST['postid']);
$ar->connectPdo('blogdb', 'categorytable', $_POST['username'], $_POST['password']);
$ar->delete($_POST['postid']);
示例11: delete
/**
* Delete also related certificate definitions and assets
*/
public function delete()
{
parent::delete();
$definitions = srCertificateDefinition::where(array('type_id' => $this->getId()))->get();
/** @var $def srCertificateDefinition */
foreach ($definitions as $def) {
$def->delete();
}
}
示例12: delete
public static function delete($id)
{
DB::nonQuery('DELETE FROM `%s` WHERE CategoryID = %u', array(CategoryItem::$tableName, $id));
return parent::delete($id);
}
示例13: EliminarAdmin
public function EliminarAdmin()
{
$db = new db();
$db->connect();
$C = new ActiveRecord('usuarios');
$C->fields['id_usuario'] = $this->id_usuario;
$C->delete();
$db->close();
}
示例14: EliminarAlbaranes
public function EliminarAlbaranes()
{
$db = new db();
$db->connect();
$C = new ActiveRecord('albaranes');
$C->fields['id_albaranes'] = $this->id_albaranes;
$C->delete();
$db->close();
}
示例15: delete
/**
* Also delete certificate file
*/
public function delete()
{
parent::delete();
@unlink($this->getFilePath());
}