SoftDelete\Model\Table\SoftDeleteTrait::hardDelete PHP Method

hardDelete() public method

Hard deletes the given $entity.
public hardDelete ( Cake\Datasource\EntityInterface $entity ) : boolean
$entity Cake\Datasource\EntityInterface
return boolean true in case of success, false otherwise.
    public function hardDelete(EntityInterface $entity)
    {
        if (!$this->delete($entity)) {
            return false;
        }
        $primaryKey = (array) $this->primaryKey();
        $query = $this->query();
        $conditions = (array) $entity->extract($primaryKey);
        $statement = $query->delete()->where($conditions)->execute();
        $success = $statement->rowCount() > 0;
        if (!$success) {
            return $success;
        }
        return $success;
    }