const STATE_TCLEAN = 5;
const STATE_LOCKED = 6;
- protected $_node;
protected $_id = array();
protected $_data = array();
protected $_values = array();
unset($vars['_table']);
unset($vars['_errorStack']);
unset($vars['_filter']);
- unset($vars['_node']);
$name = $this->_table->getIdentifier();
$this->_data = array_merge($this->_data, $this->_id);
return $this;
}
- public function getNode()
- {
- if ( ! $this->_table->isTree()) {
- return false;
- }
-
- if ( ! isset($this->_node)) {
- $this->_node = IPF_ORM_Node::factory($this,
- $this->getTable()->getOption('treeImpl'),
- $this->getTable()->getOption('treeOptions')
- );
- }
-
- return $this->_node;
- }
-
public function unshiftFilter(IPF_ORM_Record_Filter $filter)
{
return $this->_table->unshiftFilter($filter);
throw new IPF_ORM_Exception(sprintf('Unknown method %s::%s', get_class($this), $method));
}
- public function deleteNode()
- {
- $this->getNode()->delete();
- }
-
public function free($deep = false)
{
if ($this->_state != self::STATE_LOCKED) {
'type' => null,
'charset' => null,
'collation' => null,
- 'treeImpl' => null,
- 'treeOptions' => array(),
'indexes' => array(),
'parents' => array(),
'joinedParents' => array(),
'subclasses' => array(),
);
- protected $_tree;
protected $_parser;
protected $_templates = array();
$this->initIdentifier();
$this->record->setUp();
-
- // if tree, set up tree
- if ($this->isTree()) {
- $this->getTree()->setUp();
- }
} else {
if ( ! isset($this->_options['tableName'])) {
$this->setTableName(IPF_ORM_Inflector::tableize($this->_options['name']));
$this->_options['declaringClass'] = $class;
- // set the table definition for the given tree implementation
- if ($this->isTree()) {
- $this->getTree()->setTableDefinition();
- }
-
$this->columnCount = count($this->_columns);
if ( ! isset($this->_options['tableName'])) {
case 'enumMap':
case 'inheritanceMap':
case 'index':
- case 'treeOptions':
- if ( ! is_array($value)) {
- throw new IPF_ORM_Exception($name . ' should be an array.');
- }
+ if (!is_array($value))
+ throw new IPF_ORM_Exception($name . ' should be an array.');
break;
}
$this->_options[$name] = $value;
return $value;
}
- public function getTree()
- {
- if (isset($this->_options['treeImpl'])) {
- if ( ! $this->_tree) {
- $options = isset($this->_options['treeOptions']) ? $this->_options['treeOptions'] : array();
- $this->_tree = IPF_ORM_Tree::factory($this,
- $this->_options['treeImpl'],
- $options
- );
- }
- return $this->_tree;
- }
- return false;
- }
-
public function getComponentName()
{
return $this->_options['name'];
$this->setOption('tableName', $this->_conn->formatter->getTableName($tableName));
}
- public function isTree()
- {
- return ( ! is_null($this->_options['treeImpl'])) ? true : false;
- }
-
public function getTemplate($template)
{
if ( ! isset($this->_templates[$template])) {