From: Andrey Kutejko Date: Fri, 19 Jul 2013 13:36:04 +0000 (+0300) Subject: remove dead code X-Git-Tag: 0.5~157 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=f894da1dd87204a9ec5d3325f2e65eabb76f2036;p=ipf.git remove dead code --- diff --git a/ipf/orm/record.php b/ipf/orm/record.php index 298e769..ec57cb0 100644 --- a/ipf/orm/record.php +++ b/ipf/orm/record.php @@ -9,7 +9,6 @@ abstract class IPF_ORM_Record extends IPF_ORM_Record_Abstract implements Countab const STATE_TCLEAN = 5; const STATE_LOCKED = 6; - protected $_node; protected $_id = array(); protected $_data = array(); protected $_values = array(); @@ -258,7 +257,6 @@ abstract class IPF_ORM_Record extends IPF_ORM_Record_Abstract implements Countab unset($vars['_table']); unset($vars['_errorStack']); unset($vars['_filter']); - unset($vars['_node']); $name = $this->_table->getIdentifier(); $this->_data = array_merge($this->_data, $this->_id); @@ -1077,22 +1075,6 @@ abstract class IPF_ORM_Record extends IPF_ORM_Record_Abstract implements Countab 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); @@ -1225,11 +1207,6 @@ abstract class IPF_ORM_Record extends IPF_ORM_Record_Abstract implements Countab 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) { diff --git a/ipf/orm/table.php b/ipf/orm/table.php index af399f6..5d33ca2 100644 --- a/ipf/orm/table.php +++ b/ipf/orm/table.php @@ -26,8 +26,6 @@ class IPF_ORM_Table extends IPF_ORM_Configurable implements Countable 'type' => null, 'charset' => null, 'collation' => null, - 'treeImpl' => null, - 'treeOptions' => array(), 'indexes' => array(), 'parents' => array(), 'joinedParents' => array(), @@ -36,7 +34,6 @@ class IPF_ORM_Table extends IPF_ORM_Configurable implements Countable 'subclasses' => array(), ); - protected $_tree; protected $_parser; protected $_templates = array(); @@ -62,11 +59,6 @@ class IPF_ORM_Table extends IPF_ORM_Configurable implements Countable $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'])); @@ -170,11 +162,6 @@ class IPF_ORM_Table extends IPF_ORM_Configurable implements Countable $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'])) { @@ -552,10 +539,8 @@ class IPF_ORM_Table extends IPF_ORM_Configurable implements Countable 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; @@ -1174,21 +1159,6 @@ class IPF_ORM_Table extends IPF_ORM_Configurable implements Countable 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']; @@ -1204,11 +1174,6 @@ class IPF_ORM_Table extends IPF_ORM_Configurable implements Countable $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])) {