public function truncate($entity, $andCluster = false)
    {
        try {
            $validator = new RidValidator;
            $validator->check($entity);
            $commandClass = $this->getCommandClass('truncate.record');
        } catch (ValidationException $e) {
            $commandClass = $this->getCommandClass('truncate.class');

            if ($andCluster) {
                $commandClass = $this->getCommandClass('truncate.cluster');
            }
        }

        $this->command = new $commandClass($entity);

        return $this->command;
    }
public function truncate($entity, $andCluster = false)
    {
        try {
            $validator = new RidValidator;
            $validator->check($entity);
            $commandClass = $this->getCommandClass('truncate.record');
        } catch (ValidationException $e) {
            $commandClass = $this->getCommandClass('truncate.class');

            if ($andCluster) {
                $commandClass = $this->getCommandClass('truncate.cluster');
            }
        }

        $this->command = new $commandClass($entity);

        return $this->command;
    }
public function truncate ( $ entity , $ andCluster = false ) { try { $ validator = new RidValidator ; $ validator -> check ( $ entity ) ; $ commandClass = $ this -> getCommandClass ( 'truncate.record' ) ; } catch ( ValidationException $ e ) { $ commandClass = $ this -> getCommandClass ( 'truncate.class' ) ; if ( $ andCluster ) { $ commandClass = $ this -> getCommandClass ( 'truncate.cluster' ) ; } } $ this -> command = new $ commandClass ( $ entity ) ; return $ this -> command ; }
Truncates an entity.

@param  string  $entity
@param  boolean $andCluster
@return Query
Truncates an entity .