Example #1
0
 /**
  * Starts the profile of a SQL sentence
  *
  * @param string $sqlStatement
  * @param null|array   $sqlVariables
  * @param null|array   $sqlBindTypes
  *
  * @return PhalconProfiler
  */
 public function startProfile($sqlStatement, $sqlVariables = null, $sqlBindTypes = null)
 {
     $this->handleFailed();
     $activeProfile = new Item();
     $activeProfile->setSqlStatement($sqlStatement);
     $activeProfile->setRealSQL($this->getRealSql($sqlStatement, $sqlVariables, $sqlBindTypes));
     if (is_array($sqlVariables)) {
         $activeProfile->setSqlVariables($sqlVariables);
     }
     if (is_array($sqlBindTypes)) {
         $activeProfile->setSqlBindTypes($sqlBindTypes);
     }
     $activeProfile->setInitialTime(microtime(true));
     if (method_exists($this, "beforeStartProfile")) {
         $this->beforeStartProfile($activeProfile);
     }
     $this->_activeProfile = $activeProfile;
     $this->_stoped = false;
     return $this;
 }