/** * @see RedBean_Adapter::getCell */ public function getCell($sql, $bindings = array(), $noSignal = NULL) { $this->sql = $sql; if (!$noSignal) { $this->signal('sql_exec', $this); } $arr = $this->db->getCol($sql, $bindings); if ($arr && is_array($arr) && isset($arr[0])) { return $arr[0]; } return NULL; }
/** * Retrieves a single cell. * This function allows you to provide an array with values to bind * to query parameters. For instance you can bind values to question * marks in the query. Each value in the array corresponds to the * question mark in the query that matches the position of the value in the * array. You can also bind values using explicit keys, for instance * array(":key"=>123) will bind the integer 123 to the key :key in the * SQL. * * @param string $sql sql code to execute * @param array $values assoc. array binding values * * @return array $result scalar result set */ public function getCell($sql, $aValues = array(), $noSignal = null) { $this->sql = $sql; if (!$noSignal) { $this->signal("sql_exec", $this); } $arr = $this->db->getCol($sql, $aValues); if ($arr && is_array($arr)) { return $arr[0]; } else { return false; } }
/** * Retrieves a single cell. * This function allows you to provide an array with values to bind * to query parameters. For instance you can bind values to question * marks in the query. Each value in the array corresponds to the * question mark in the query that matches the position of the value in the * array. You can also bind values using explicit keys, for instance * array(":key"=>123) will bind the integer 123 to the key :key in the * SQL. * * @param string $sql sql code to execute * @param array $values assoc. array binding values * * @return array $result scalar result set */ public function getCell($sql, $aValues = array(), $noSignal = null) { $this->sql = $sql; if (!$noSignal) { $this->signal('sql_exec', $this); } $timer = new $this->performanceTimerClass(PerformanceTimer::CATEGORY_SQL); $timer->startTimer(); $arr = $this->db->getCol($sql, $aValues); $timer->stopTimer(); $timer->saveTime(); if ($arr && is_array($arr)) { return $arr[0]; } else { return false; } }