Pop\Db\Sql::select PHP Method

select() public method

Create a select statement
public select ( mixed $columns = null ) : Select
$columns mixed
return Pop\Db\Sql\Select
    public function select($columns = null)
    {
        if (null === $this->clause || !$this->clause instanceof \Pop\Db\Sql\Select) {
            $this->clause = new Sql\Select($this, $columns);
        }
        return $this->clause;
    }

Usage Example

Example #1
0
 /**
  * Method to load a value from cache.
  *
  * @param  string $id
  * @param  string $time
  * @return mixed
  */
 public function load($id, $time)
 {
     $value = false;
     // Retrieve the value.
     $this->sqlite->select()->where()->equalTo('id', ':id');
     $this->sqlite->adapter()->prepare($this->sqlite->render(true))->bindParams(array('id' => sha1($id)))->execute();
     $rows = $this->sqlite->adapter()->fetchResult();
     // If the value is found, check expiration and return.
     if (count($rows) > 0) {
         $data = $rows[0]['value'];
         $dbTime = $rows[0]['time'];
         if (time() - $dbTime <= $time) {
             $value = unserialize($data);
         }
     }
     return $value;
 }
All Usage Examples Of Pop\Db\Sql::select