<?php
namespace Moto\Application\Util\Tree; use Moto\Application\Model\AbstractTable; use Moto; abstract class Tree { protected $_options = array(); protected $_context = null; public function __construct(AbstractTable $context, $options = array()) { $this->_context = $context; $this->_options = array_merge($this->_options, array_intersect_key($options, $this->_options)); } protected function _query($sql) { return $this->_context->getAdapter()->getDriver()->createStatement($sql)->execute(); } public function getTableName() { return $this->_context->table; } abstract public function insert(array $data); abstract public function getParentBranch($id); abstract public function delete($where); abstract public function moveNode($id, $newParentId); }