RedBeanPHP\Repository::wipe PHP Method

wipe() public method

Trash all beans of a given type. Wipes an entire type of bean.
public wipe ( string $type ) : boolean
$type string type of bean you wish to delete all instances of
return boolean
    public function wipe($type)
    {
        try {
            $this->writer->wipe($type);
            return TRUE;
        } catch (SQLException $exception) {
            if (!$this->writer->sqlStateIn($exception->getSQLState(), array(QueryWriter::C_SQLSTATE_NO_SUCH_TABLE))) {
                throw $exception;
            }
            return FALSE;
        }
    }

Usage Example

示例#1
0
 /**
  * Trash all beans of a given type. Wipes an entire type of bean.
  *
  * @param string $type type of bean you wish to delete all instances of
  *
  * @return boolean
  */
 public function wipe($type)
 {
     return $this->repository->wipe($type);
 }