/home/gotham/public_html/library/db/CDbCommand.php(358)
346 { 347 if($this->_connection->enableProfiling) 348 Yii::endProfile('system.db.CDbCommand.execute('.$this->getText().$par.')','system.db.CDbCommand.execute'); 349 350 $errorInfo=$e instanceof PDOException ? $e->errorInfo : null; 351 $message=$e->getMessage(); 352 Yii::log(Yii::t('yii','CDbCommand::execute() failed: {error}. The SQL statement executed was: {sql}.', 353 array('{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand'); 354 355 if(YII_DEBUG) 356 $message.='. The SQL statement executed was: '.$this->getText().$par; 357 358 throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}', 359 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo); 360 } 361 } 362 363 /** 364 * Executes the SQL statement and returns query result. 365 * This method is for executing an SQL query that returns result set. 366 * @param array $params input parameters (name=>value) for the SQL execution. This is an alternative 367 * to {@link bindParam} and {@link bindValue}. If you have multiple input parameters, passing 368 * them in this way can improve the performance. Note that if you pass parameters in this way, 369 * you cannot bind parameters or values using {@link bindParam} or {@link bindValue}, and vice versa. 370 * Please also note that all values are treated as strings in this case, if you need them to be handled as
#0 |
+
–
/home/gotham/public_html/library/db/ar/CActiveRecord.php(1077): CDbCommand->execute() 1072 { 1073 Yii::trace(get_class($this).'.insert()','system.db.ar.CActiveRecord'); 1074 $builder=$this->getCommandBuilder(); 1075 $table=$this->getMetaData()->tableSchema; 1076 $command=$builder->createInsertCommand($table,$this->getAttributes($attributes)); 1077 if($command->execute()) 1078 { 1079 $primaryKey=$table->primaryKey; 1080 if($table->sequenceName!==null) 1081 { 1082 if(is_string($primaryKey) && $this->$primaryKey===null) |
#1 |
+
–
/home/gotham/public_html/library/db/ar/CActiveRecord.php(806): CActiveRecord->insert(null) 801 * @return boolean whether the saving succeeds 802 */ 803 public function save($runValidation=true,$attributes=null) 804 { 805 if(!$runValidation || $this->validate($attributes)) 806 return $this->getIsNewRecord() ? $this->insert($attributes) : $this->update($attributes); 807 else 808 return false; 809 } 810 811 /** |
#2 |
+
–
/home/gotham/public_html/application/models/database/Cart.php(48): CActiveRecord->save() 43 private static function createCart($user_id = 0) 44 { 45 $cart = new self(); 46 $cart->user_id = $user_id; 47 $cart->date = date("Y-m-d H:i:s"); 48 $cart->save(); 49 Yii::app()->user->setState('CartID', $cart->id); 50 51 return $cart; 52 } 53 |
#3 |
+
–
/home/gotham/public_html/application/models/database/Cart.php(40): Cart::createCart(0) 35 } 36 return $model; 37 } 38 } 39 40 return self::createCart($user_id); 41 } 42 43 private static function createCart($user_id = 0) 44 { 45 $cart = new self(); |
#4 |
+
–
/home/gotham/public_html/application/controllers/CartController.php(24): Cart::getCart() 19 )); 20 } 21 22 public function actionAdd($id) 23 { 24 $cart = Cart::getCart(); 25 $cart->addProduct(Product::model()->findByPk($id)); 26 $_SESSION['cart_state'] = Cart::_ADD_; 27 $this->redirect('/cart'); 28 } 29 |
#5 |
unknown(0): CartController->actionAdd("3580")
|
#6 |
+
–
/home/gotham/public_html/library/web/actions/CAction.php(108): ReflectionMethod->invokeArgs(CartController, array("3580")) 103 elseif($param->isDefaultValueAvailable()) 104 $ps[]=$param->getDefaultValue(); 105 else 106 return false; 107 } 108 $method->invokeArgs($object,$ps); 109 return true; 110 } 111 } |
#7 |
+
–
/home/gotham/public_html/library/web/actions/CInlineAction.php(47): CAction->runWithParamsInternal(CartController, ReflectionMethod, array("id" => "3580")) 42 { 43 $methodName='action'.$this->getId(); 44 $controller=$this->getController(); 45 $method=new ReflectionMethod($controller, $methodName); 46 if($method->getNumberOfParameters()>0) 47 return $this->runWithParamsInternal($controller, $method, $params); 48 else 49 return $controller->$methodName(); 50 } 51 52 } |
#8 |
+
–
/home/gotham/public_html/library/web/CController.php(308): CInlineAction->runWithParams(array("id" => "3580")) 303 { 304 $priorAction=$this->_action; 305 $this->_action=$action; 306 if($this->beforeAction($action)) 307 { 308 if($action->runWithParams($this->getActionParams())===false) 309 $this->invalidActionParams($action); 310 else 311 $this->afterAction($action); 312 } 313 $this->_action=$priorAction; |
#9 |
+
–
/home/gotham/public_html/library/web/CController.php(286): CController->runAction(CInlineAction) 281 * @see runAction 282 */ 283 public function runActionWithFilters($action,$filters) 284 { 285 if(empty($filters)) 286 $this->runAction($action); 287 else 288 { 289 $priorAction=$this->_action; 290 $this->_action=$action; 291 CFilterChain::create($this,$action,$filters)->run(); |
#10 |
+
–
/home/gotham/public_html/library/web/CController.php(265): CController->runActionWithFilters(CInlineAction, array()) 260 { 261 if(($parent=$this->getModule())===null) 262 $parent=Yii::app(); 263 if($parent->beforeControllerAction($this,$action)) 264 { 265 $this->runActionWithFilters($action,$this->filters()); 266 $parent->afterControllerAction($this,$action); 267 } 268 } 269 else 270 $this->missingAction($actionID); |
#11 |
+
–
/home/gotham/public_html/library/web/CWebApplication.php(282): CController->run("add") 277 { 278 list($controller,$actionID)=$ca; 279 $oldController=$this->_controller; 280 $this->_controller=$controller; 281 $controller->init(); 282 $controller->run($actionID); 283 $this->_controller=$oldController; 284 } 285 else 286 throw new CHttpException(404,Yii::t('yii','Unable to resolve the request "{route}".', 287 array('{route}'=>$route===''?$this->defaultController:$route))); |
#12 |
+
–
/home/gotham/public_html/library/web/CWebApplication.php(141): CWebApplication->runController("cart/add") 136 foreach(array_splice($this->catchAllRequest,1) as $name=>$value) 137 $_GET[$name]=$value; 138 } 139 else 140 $route=$this->getUrlManager()->parseUrl($this->getRequest()); 141 $this->runController($route); 142 } 143 144 /** 145 * Registers the core application components. 146 * This method overrides the parent implementation by registering additional core components. |
#13 |
+
–
/home/gotham/public_html/library/base/CApplication.php(180): CWebApplication->processRequest() 175 public function run() 176 { 177 if($this->hasEventHandler('onBeginRequest')) 178 $this->onBeginRequest(new CEvent($this)); 179 register_shutdown_function(array($this,'end'),0,false); 180 $this->processRequest(); 181 if($this->hasEventHandler('onEndRequest')) 182 $this->onEndRequest(new CEvent($this)); 183 } 184 185 /** |
#14 |
+
–
/home/gotham/public_html/index.php(12): CApplication->run() 07 // include Yii bootstrap file 08 require_once($_SERVER['DOCUMENT_ROOT'].'/library/yii.php'); 09 10 // create application instance and run 11 $config_file = $_SERVER['DOCUMENT_ROOT'].'/application/config/main.php'; 12 Yii::createWebApplication($config_file)->run(); |