/** * @param int $key * @param int $delta */ private function shiftLeftRight($key, $delta) { $owner = $this->getOwner(); foreach (array($this->leftAttribute, $this->rightAttribute) as $attribute) { $condition = $attribute . '>=' . $key; if ($this->hasManyRoots) { $condition .= ' AND ' . $this->rootAttribute . '=' . $owner->{$this->rootAttribute}; } $query = sprintf('UPDATE %s SET %s=%s+%d WHERE %s', $this->owner->getSource(), $attribute, $attribute, $delta, $condition); $this->owner->getWriteConnection()->execute($query); } }
public function getSource() { //Phalcon can't find camelcase table names return lcfirst(Text::camelize(parent::getSource())); }
/** * Get db table full name * @return string */ public function getSource() { if (!$this->tableName) { $this->tableName = parent::getSource(); } return $this->getPrefix() . $this->tableName; }