Zend_Db_Table_Abstract::select PHP Method

select() public method

Returns an instance of a Zend_Db_Table_Select object.
public select ( boolean $withFromPart = self::SELECT_WITHOUT_FROM_PART ) : Zend_Db_Table_Select
$withFromPart boolean Whether or not to include the from part of the select based on the table
return Zend_Db_Table_Select
    public function select($withFromPart = self::SELECT_WITHOUT_FROM_PART)
    {
        require_once 'Zend/Db/Table/Select.php';
        $select = new Zend_Db_Table_Select($this);
        if ($withFromPart == self::SELECT_WITH_FROM_PART) {
            $select->from($this->info(self::NAME), Zend_Db_Table_Select::SQL_WILDCARD, $this->info(self::SCHEMA));
        }
        return $select;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Find admin
  *
  * @param int $applicationId
  * @param string $username
  * @param Admin_Model_Admin $admin
  * @return boolean
  */
 public function find($applicationId, $username, Admin_Model_Admin $admin)
 {
     $select = $this->_dbTable->select();
     $select->setIntegrityCheck(false)->from(array('a' => 'admin'), array('a.*'))->joinLeft(array("aa" => "admin_application"), "aa.admin_id = a.id")->where('a.username = ?', $username)->where('aa.application_id = ?', $applicationId);
     $resultSet = $this->_dbTable->fetchAll($select);
     if (0 == count($resultSet)) {
         return false;
     }
     //get first row from resultSet
     $row = $resultSet->current();
     $admin->setOptions($row->toArray());
     return true;
 }
All Usage Examples Of Zend_Db_Table_Abstract::select