protected function getQuery()
 {
     return sprintf(
         "UPDATE %s SET `title` = %s WHERE id = %d",
         $this->getReadAdapter()->quoteIdentifier( $this->entity->getTable() ),
         $this->getReadAdapter()->quote( $this->entity->getTitle() ),
         (int)$this->entity->getId()
     );
 }
    function getBind()
    {
        $bind = array();
        if ($this->requestedSaveId) {
            $bind['id'] = $this->requestedSaveId;
        }

        $bind['title'] = $this->entity->getTitle();
        return $bind;
    }
Exemplo n.º 3
0
 function getBind()
 {
     $bind = array();
     if ($this->requestedSaveId) {
         $bind['id'] = $this->requestedSaveId;
     }
     if ($this->entity->getPrevLevel()) {
         $parentKey = $this->entity->getPrevLevel() . '_id';
         if (is_numeric($this->parent_id) && $this->parent_id) {
             $bind[$this->inflect($parentKey)] = $this->parent_id;
         }
         if (is_array($this->parent_id)) {
             $bind[$this->inflect($parentKey)] = $this->parent_id[$this->entity->getPrevLevel()];
         }
     }
     $bind['title'] = $this->entity->getTitle();
     return $bind;
 }