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


PHP DibiConnection::delete方法代码示例

本文整理汇总了PHP中DibiConnection::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP DibiConnection::delete方法的具体用法?PHP DibiConnection::delete怎么用?PHP DibiConnection::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DibiConnection的用法示例。


在下文中一共展示了DibiConnection::delete方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: deleteId

 /**
  * @param $id numeric
  *
  * @throws Exception
  */
 public function deleteId($id)
 {
     if (!is_numeric($id)) {
         throw new Exception('Wrong DELETE parameter: Non-numeric ID not allowed');
     }
     $this->database->delete($this->table)->where('id = ?', (int) $id)->execute();
 }
开发者ID:bombush,项目名称:NatsuCon,代码行数:12,代码来源:EntityModel.php

示例2: deleteItem

 /**
  * @param object $instance
  * @param ClassMetadata $classMetadata
  * @return \DibiResult|int
  */
 private function deleteItem($instance, ClassMetadata $classMetadata)
 {
     $affectedRows = $this->dibiConnection->delete($classMetadata->getTable())->where($this->buildPrimaryKey($instance, $classMetadata))->execute(\dibi::AFFECTED_ROWS);
     $classKey = $this->getEntityClassHashKey($instance);
     unset($this->managedClasses[$classKey]);
     return $affectedRows;
 }
开发者ID:doublemcz,项目名称:dibi-orm,代码行数:12,代码来源:Manager.php

示例3: createModifyManyToMany

 public function createModifyManyToMany(Association\ManyToMany $association, $primaryValue, array $refKeys, $action = self::ASSOC_ADD)
 {
     if ($action === self::ASSOC_ADD) {
         $fluent = $this->connection->insert($association->getJoinResource(), [$association->getJoinKey() => array_fill(0, count($refKeys), $primaryValue), $association->getReferencingKey() => $refKeys]);
     } else {
         $fluent = $this->connection->delete($association->getJoinResource())->where("%n = %s", $association->getJoinKey(), $primaryValue)->and("%n IN %l", $association->getReferencingKey(), $refKeys);
     }
     $query = new Query($fluent);
     $query->resultCallback = function (Query $query) {
         return $query->fluent->execute();
     };
     return $query;
 }
开发者ID:bauer01,项目名称:unimapper-dibi,代码行数:13,代码来源:Adapter.php

示例4: remove

 /**
  * Remove authorization code
  * @param string $authorizationCode
  * @return void
  */
 public function remove($authorizationCode)
 {
     $this->context->delete($this->getTable())->where('authorization_code = %s', $authorizationCode)->execute();
 }
开发者ID:drahak,项目名称:oauth2,代码行数:9,代码来源:AuthorizationCodeStorage.php

示例5: tearDown

 protected function tearDown()
 {
     $this->db->delete("pages")->execute();
     $this->db->delete("connections")->execute();
     $this->db->delete("tags")->execute();
 }
开发者ID:janmarek,项目名称:Ormion,代码行数:6,代码来源:ManyToManyTest.php

示例6: delete

 public function delete($id)
 {
     return $this->connection->delete($this->table)->where('id=%i', $id)->execute();
 }
开发者ID:vrana,项目名称:nette,代码行数:4,代码来源:Albums.php

示例7: delete

 /**
  * @param int $id
  * @return bool
  */
 public function delete($id)
 {
     $this->database->delete(self::TABLE)->where(self::TABLE . '.id = %i', $id)->execute();
     return $this->database->getAffectedRows() == 1;
 }
开发者ID:josiff,项目名称:fri-sandbox,代码行数:9,代码来源:ArticleModel.php

示例8: remove

 /**
  * Remove refresh token
  * @param string $refreshToken
  */
 public function remove($refreshToken)
 {
     $this->context->delete($this->getTable())->where(array('refresh_token' => $refreshToken))->execute();
 }
开发者ID:drahak,项目名称:oauth2,代码行数:8,代码来源:RefreshTokenStorage.php


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