Reputation: 18006
I know that this statement updates the record in the zend framework. But I want to understand the complete flow of this statement. Statement is
$request->update($data,$request->getAdapter()->quoteInto('id = ?',$this->getRequest()->getParam('selected_id'))) )
$data
is the array of records that is passed to it and $request
is the object of model. I want to know whole meaning of this statement
Upvotes: 2
Views: 208
Reputation: 14318
As you know update statement uses $table->update($data, $where);
$request
is db table model. ->getAdapter
gets the adapter.
Also quoteInto()
is best defined as by documentation
The most typical usage of quoting is to interpolate a PHP variable into a SQL expression or statement. You can use the quoteInto() method to do this in one step. This method takes two arguments: the first argument is a string containing a placeholder symbol (?), and the second argument is a value or PHP variable that should be substituted for that placeholder.
And the last expression $this->getRequest()->getParam('selected_id')
.
$this->getRequest()
gets the request $_GET
type
And getParam('selected_id'))
fetches selected_id
of GET
object.
Upvotes: 2