public function select(array $criteria = array(),
            $return = Table::RETURN_MODEL) {
        if (!$this->checkExists()) {
            return ($this->delayExecute) ? $this : new ArrayCollection();
        }

        $this->current = self::OP_SELECT;

        $this->query = 'SELECT ' . $this->prepareColumns();
        $this->query .= ' FROM `' . $this->name . '`' . $this->processJoins();

        $this->where($criteria);

        $this->setExpectedResult($return, true);
        if ($this->delayExecute) {
            return $this;
        }
        return $this->execute();
    }
public function select(array $criteria = array(),
            $return = Table::RETURN_MODEL) {
        if (!$this->checkExists()) {
            return ($this->delayExecute) ? $this : new ArrayCollection();
        }

        $this->current = self::OP_SELECT;

        $this->query = 'SELECT ' . $this->prepareColumns();
        $this->query .= ' FROM `' . $this->name . '`' . $this->processJoins();

        $this->where($criteria);

        $this->setExpectedResult($return, true);
        if ($this->delayExecute) {
            return $this;
        }
        return $this->execute();
    }
public function select ( array $ criteria = array ( ) , $ return = Table :: RETURN_MODEL ) { if ( ! $ this -> checkExists ( ) ) { return ( $ this -> delayExecute ) ? $ this : new ArrayCollection ( ) ; } $ this -> current = self :: OP_SELECT ; $ this -> query = 'SELECT ' . $ this -> prepareColumns ( ) ; $ this -> query .= ' FROM `' . $ this -> name . '`' . $ this -> processJoins ( ) ; $ this -> where ( $ criteria ) ; $ this -> setExpectedResult ( $ return , true ) ; if ( $ this -> delayExecute ) { return $ this ; } return $ this -> execute ( ) ; }
Selects rows from database
Many rows can be passed in as criteria
@param array $criteria Array with values \DBScribe\Row or array of [column => value]
@param int $return Indicates the type of result expected
@return Table|ArrayCollection
Selects rows from database Many rows can be passed in as criteria