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; }
protected function saveLevelWithParent() { return sprintf("UPDATE %s SET `title` = %s, %s = %d WHERE id = %d", $this->getReadAdapter()->quoteIdentifier($this->entity->getTable()), $this->getReadAdapter()->quote($this->entity->getTitle()), $this->getReadAdapter()->quoteIdentifier($this->entity->getPrevLevel() . '_id'), (int) $this->parent_id, (int) $this->entity->getId()); }