From 9a45ebab57de6f5d9e44fa9dc04878a07563ce53 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 17 Dec 2006 04:08:08 +0000 Subject: [PATCH] Remove the relations system. It was stupid. --- api.php | 68 --------------------------------------------------------- 1 file changed, 68 deletions(-) diff --git a/api.php b/api.php index 4dc7a84..2fb6d37 100644 --- a/api.php +++ b/api.php @@ -61,26 +61,6 @@ if (!defined('REQ_AUTO')) * Index for verification type */ define('F_VERIFY', 2); - - /** - * Index for relation - */ - define('F_RELATION', 3); - - /** - * Relation index for file name, relative to ISSO->apppath - */ - define('F_RELATION_FILE', 0); - - /** - * Relation index for class name - */ - define('F_RELATION_CLASS', 1); - - /** - * Relation index for field-link alternate name - */ - define('F_RELATION_ALTFIELD', 2); } /** @@ -117,12 +97,6 @@ abstract class BSApi */ private $setfields = array(); - /** - * An array of all of the processed relations on an object - * @var array - */ - public $relations = array(); - /** * WHERE condition * @var string @@ -147,12 +121,6 @@ abstract class BSApi */ public $norunners = array(); - /** - * The relations to execute on - * @var array - */ - public $dorelations = array('fetch'); - /** * Error list that has been generated * @var array @@ -499,42 +467,6 @@ abstract class BSApi $actmethod = (method_exists($this, $method) ? $this->$method() : ''); } - // ################################################################### - /** - * Determines if it's safe to run a relation; if so, it will return - * the WHERE SQL clause - * - * @param string Operation to run - */ - public function callRelations($method) - { - if (!is_array($this->dorelations) OR !in_array($method, $this->dorelations)) - { - return; - } - - foreach ($this->fields AS $field => $info) - { - $value = (isset($this->values["$field"]) ? $this->values["$field"] : $this->objdata["$field"]); - if ($value == null OR !is_array($info[F_RELATION])) - { - continue; - } - - if (!file_exists(BSRegister::GetApplicationPath() . $info[F_RELATION][F_RELATION_FILE])) - { - trigger_error("Could not load the relation file for field '$field'"); - } - - require_once(BSRegister::GetApplicationPath() . $info[F_RELATION][F_RELATION_FILE]); - - $this->relations["$field"] = new $info[F_RELATION][F_RELATION_CLASS]($this->registry); - $this->relations["$field"]->set(($info[F_RELATION][F_RELATION_ALTFIELD] ? $info[F_RELATION][F_RELATION_ALTFIELD] : $field), $value); - $this->relations["$field"]->setCondition(); - $this->relations["$field"]->$method(); - } - } - // ################################################################### /** * Prepares a value for use in a SQL query; it encases and escapes -- 2.22.5