From 7b0de9774e0930fbdd98cee510e59f1d89f6c7fe Mon Sep 17 00:00:00 2001 From: avl Date: Mon, 22 Dec 2008 14:39:28 +0200 Subject: [PATCH] nullable foreign key --- ipf/orm/relation.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ipf/orm/relation.php b/ipf/orm/relation.php index 37bc94f..7427197 100644 --- a/ipf/orm/relation.php +++ b/ipf/orm/relation.php @@ -9,7 +9,7 @@ abstract class IPF_ORM_Relation implements ArrayAccess const ONE = 0; const MANY = 2; - + protected $definition = array('alias' => true, 'foreign' => true, 'local' => true, @@ -39,7 +39,7 @@ abstract class IPF_ORM_Relation implements ArrayAccess if (isset($definition[$key])) { $def[$key] = $definition[$key]; } else { - $def[$key] = $this->definition[$key]; + $def[$key] = $this->definition[$key]; } } $this->definition = $def; @@ -75,7 +75,7 @@ abstract class IPF_ORM_Relation implements ArrayAccess if (isset($this->definition[$offset])) { return $this->definition[$offset]; } - + return null; } @@ -91,7 +91,7 @@ abstract class IPF_ORM_Relation implements ArrayAccess $this->definition[$offset] = false; } - public function toArray() + public function toArray() { return $this->definition; } @@ -105,7 +105,7 @@ abstract class IPF_ORM_Relation implements ArrayAccess { return $this->definition['type']; } - + public function isCascadeDelete() { return in_array('delete', $this->definition['cascade']); @@ -127,7 +127,7 @@ abstract class IPF_ORM_Relation implements ArrayAccess { return $this->definition['local']; } - + final public function getLocalFieldName() { return $this->definition['localTable']->getFieldName($this->definition['local']); @@ -137,7 +137,7 @@ abstract class IPF_ORM_Relation implements ArrayAccess { return $this->definition['foreign']; } - + final public function getForeignFieldName() { return $this->definition['table']->getFieldName($this->definition['foreign']); -- 2.49.0