]> git.andy128k.dev Git - ipf-legacy-orm.git/commitdiff
remove dead code
authorAndrey Kutejko <andy128k@gmail.com>
Fri, 19 Jul 2013 13:36:04 +0000 (16:36 +0300)
committerAndrey Kutejko <andy128k@gmail.com>
Fri, 19 Jul 2013 13:36:04 +0000 (16:36 +0300)
ipf/orm/record.php
ipf/orm/table.php

index 298e7693f82ff3fe3b98f8b1ecb80236ec512bbc..ec57cb0de266a24c96688037d46e9bcda496f263 100644 (file)
@@ -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) {
index af399f6b49c3c73679087fed9032c0a655cd34c0..5d33ca2ba067a87f9fc53308277bf9be76971e7f 100644 (file)
@@ -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])) {