コード例 #1
0
ファイル: EntityModel.php プロジェクト: bombush/NatsuCon
 /**
  * @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();
 }
コード例 #2
0
ファイル: Manager.php プロジェクト: doublemcz/dibi-orm
 /**
  * @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;
 }
コード例 #3
0
ファイル: Adapter.php プロジェクト: bauer01/unimapper-dibi
 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;
 }
コード例 #4
0
 /**
  * Remove authorization code
  * @param string $authorizationCode
  * @return void
  */
 public function remove($authorizationCode)
 {
     $this->context->delete($this->getTable())->where('authorization_code = %s', $authorizationCode)->execute();
 }
コード例 #5
0
ファイル: ManyToManyTest.php プロジェクト: janmarek/Ormion
 protected function tearDown()
 {
     $this->db->delete("pages")->execute();
     $this->db->delete("connections")->execute();
     $this->db->delete("tags")->execute();
 }
コード例 #6
0
ファイル: Albums.php プロジェクト: vrana/nette
 public function delete($id)
 {
     return $this->connection->delete($this->table)->where('id=%i', $id)->execute();
 }
コード例 #7
0
ファイル: ArticleModel.php プロジェクト: josiff/fri-sandbox
 /**
  * @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;
 }
コード例 #8
0
ファイル: RefreshTokenStorage.php プロジェクト: drahak/oauth2
 /**
  * Remove refresh token
  * @param string $refreshToken
  */
 public function remove($refreshToken)
 {
     $this->context->delete($this->getTable())->where(array('refresh_token' => $refreshToken))->execute();
 }