Delete by primary key

@param string|array $pk
@return int|boolean
968267
public function deleteByPK($pk){
        $pkConditions = $this->buildPKConditions($this->pk, $pk);
        return $this->delete($pkConditions[0], $pkConditions[1]);
    }
741036
public function delete($key)
	{
		if (isset($this->jar[$key]) and ! $this->jar[$key]->isDeleted())
		{
			return $this->jar[$key]->delete();
		}
		elseif ($this->has($key))
		{
			return $this->parent->delete($key);
		}

		return false;
	}
217674
public function remove()
    {
        if (!isset($this->_pkValue)) {
            return false;
        }
        if (self::delete($this->_pkValue) > 0) {
            $this->_pkValue = null;
            return true;
        }
        return false;
    }
718671
public function remove($pKey)
    {
        $file = $this->_loadFile($pKey);

        if (isset($this->_files[$file][$pKey])) {
            unset($this->_files[$file][$pKey]);
            $this->_save($file);
        }

        return $this;
    }
735179
private function getSingleResult($pk)
    {
        $model = $this->_get($pk);
        $code = 200;
        $return = array();
        if (NULL === $model || !method_exists($model, 'toArray')) {
            $code = 404;
        } else {
            $return = $model->toArray($this->fieldType ?: TableMap::TYPE_PHPNAME, true, [], true);
        }

        return array($code, $return);
    }
745281
public function decrementByPk($primary_key, $keys, $step = 1)
    {
        if ($this->is_single) {
            return $this->incrementOrDecrementByPk($primary_key, $keys, $step, self::MINUS_NOTIFICATION);
        }
        return false;
    }
888949
public function removeByIndex( $key, $value ){
		$this->table->focusIndex( $key, $value );
		$number	= 0;
		$rows	= $this->table->get( FALSE );
		if( count( $rows ) ){
			$number = $this->table->delete();
			foreach( $rows as $row ){
				switch( $this->fetchMode ){
					case \PDO::FETCH_CLASS:
					case \PDO::FETCH_OBJ:
						$id	= $row->{$this->primaryKey};
						break;
					default:
						$id	= $row[$this->primaryKey];
				}
				$this->cache->remove( $this->cacheKey.$id );
			}
			$result	= TRUE;
		}
		$this->table->defocus();
		return $number;
	}
466129
public function hasPrimaryKey() {

        $pks = (array) $this->pk;
        $ret = true;

        foreach($pks as $pk) {

            $value = $this->getProperty($pk);
            if (empty($value)) {
                return false;
            }

        }

        return $ret;

    }
1198222
protected function isPk($key)
    {
        $pk = $this->getPk();
        if (is_string($pk) && $pk == $key) {
            return true;
        } elseif (is_array($pk) && in_array($key, $pk)) {
            return true;
        }

        return false;
    }
229080
public function delete($key){
        $this->connection->where('keyCache = :key', array('key' => $key));
        return $this->connection->delete($this->table);
    }
251921
public function isColumnInPK(TablePrimaryKey $pk): bool
    {
        return in_array($this->name, $pk->columns, true);
    }
797339
public function findByPrimary($pk_list = [])
    {
        $pk = $this->getPrimaryKey();
        $return = $this->newCollection();

        if ($pk_list) {
            $pk_list = array_unique($pk_list);
            foreach ($pk_list as $key => $value) {
                $item = $this->getRegistry()->get($value);
                if ($item) {
                    unset($pk_list[$key]);
                    $return[$item->{$pk}] = $item;
                }
            }
            if ($pk_list) {
                $query = $this->paramsToQuery();
                $query->where("$pk IN ?", $pk_list);
                $items = $this->findByQuery($query);

                if (count($items)) {
                    foreach ($items as $item) {
                        $this->getRegistry()->set($item->{$pk}, $item);
                        $return[$item->{$pk}] = $item;
                    }
                }
            }
        }

        return $return;
    }
413015
public static function remove($pKey)
    {
        if (! array_key_exists($pKey, self::$_registry)) {
            throw new Exception("The registry key '$pKey' doesn't exist");
        }

        if (is_object(self::$_registry[$pKey]) and method_exists(self::$_registry[$pKey], '__destruct')) {
            self::$_registry[$pKey]->__destruct();
        }

        unset(self::$_registry[$pKey]);

        return true;
    }
1307385
public function delete($pk = NULL)
    {
        $this->action = self::API_ACTION_DELETE;
        $this->closeTransaction(200);
        $deleted = FALSE;
        $message = null;
        if (NULL !== $pk) {
            try {
                $this->con->beginTransaction();
                $this->hydrateModel($pk);
                if (NULL !== $this->model) {
                    if(method_exists('clearAllReferences', $this->model)) {
                        $this->model->clearAllReferences(true);
                    }
                    $this->model->delete($this->con);
                    $deleted = TRUE;
                }
            } catch (\Exception $e) {
                $context = [];
                if(null !== $e->getPrevious()) {
                    $context[] = $e->getPrevious()->getMessage();
                }
                Logger::log($e->getMessage(), LOG_CRIT, $context);

            }
        }

        return $this->json(new JsonResponse(null, $deleted, $deleted, 0, $message), ($deleted) ? 200 : 400);
    }
1097227
public static function update($pk, $fields)
    {
        return static::getDb()->table(static::getTableName())
            ->where(static::getDb()->getTablePk(static::getTableName()) . ' = :pk')
            ->setParam(':pk', $pk)
            ->update($fields);
    }
144630
public function delete()
	{
		$this->verifyNotReadonly('delete');

		$pk = $this->valuesForPk();

		if (empty($pk))
			throw new ActiveRecordException("Cannot delete, no primary key defined for: " . get_called_class());

		if (!$this->invokeCallback('beforeDestroy',false))
			return false;

		static::table()->delete($pk);
		$this->invokeCallback('afterDestroy',false);

		return true;
	}
281422
public function delete() : int
    {
        $sql = "DELETE FROM `".$this->tableName."` "
            . "WHERE `".$this->primaryKey."` = '".$this->id."';";
        return $this->db->exec($sql);
    }