当前位置: 首页>>代码示例>>PHP>>正文


PHP ActiveRecord::delete方法代码示例

本文整理汇总了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();
 }
开发者ID:utumdol,项目名称:codeseed,代码行数:9,代码来源:blog.class.php

示例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();
     }
 }
开发者ID:imsamurai,项目名称:active-record-for-cakephp,代码行数:10,代码来源:ActiveRecordAssociationType.php

示例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();
     }
 }
开发者ID:studer-raimann,项目名称:Certificate,代码行数:13,代码来源:class.srCertificateSignature.php

示例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;
 }
开发者ID:mmendoza000,项目名称:freekore,代码行数:14,代码来源:FkUploader.class.php

示例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();
 }
开发者ID:mtaisigue,项目名称:albaranes,代码行数:9,代码来源:Perfil.php

示例6: delete

 /**
  * Cascade deletion to children.
  */
 public function delete($delete_id = null)
 {
     parent::delete($delete_id);
     $this->constituent_schools()->delete($this->delete_id);
 }
开发者ID:AholibamaSI,项目名称:plymouth-webapp,代码行数:8,代码来源:School.php

示例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}番目の記事を投稿しました";
开发者ID:pakutoma,项目名称:pakutomablog,代码行数:31,代码来源:post.php

示例8: delete

 public function delete()
 {
     foreach ($this->getUdfCheckObjects() as $udf_check) {
         $udf_check->delete();
     }
     parent::delete();
 }
开发者ID:JKN-INC,项目名称:UserDefaults,代码行数:7,代码来源:class.ilUserSetting.php

示例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();
     }
 }
开发者ID:mmendoza000,项目名称:freekore,代码行数:10,代码来源:AppSpreadSheet.php

示例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']);
开发者ID:pakutoma,项目名称:pakutomablog,代码行数:8,代码来源:delete.php

示例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();
     }
 }
开发者ID:studer-raimann,项目名称:Certificate,代码行数:12,代码来源:class.srCertificateType.php

示例12: delete

 public static function delete($id)
 {
     DB::nonQuery('DELETE FROM `%s` WHERE CategoryID = %u', array(CategoryItem::$tableName, $id));
     return parent::delete($id);
 }
开发者ID:nbey,项目名称:Emergence-Skeleton,代码行数:5,代码来源:Category.class.php

示例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();
 }
开发者ID:mtaisigue,项目名称:albaranes,代码行数:9,代码来源:Usuario.php

示例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();
 }
开发者ID:mtaisigue,项目名称:albaranes,代码行数:9,代码来源:Albaranes.php

示例15: delete

 /**
  * Also delete certificate file
  */
 public function delete()
 {
     parent::delete();
     @unlink($this->getFilePath());
 }
开发者ID:studer-raimann,项目名称:Certificate,代码行数:8,代码来源:class.srCertificate.php


注:本文中的ActiveRecord::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。