const ONE = 0;
const MANY = 2;
-
+
protected $definition = array('alias' => true,
'foreign' => true,
'local' => true,
if (isset($definition[$key])) {
$def[$key] = $definition[$key];
} else {
- $def[$key] = $this->definition[$key];
+ $def[$key] = $this->definition[$key];
}
}
$this->definition = $def;
if (isset($this->definition[$offset])) {
return $this->definition[$offset];
}
-
+
return null;
}
$this->definition[$offset] = false;
}
- public function toArray()
+ public function toArray()
{
return $this->definition;
}
{
return $this->definition['type'];
}
-
+
public function isCascadeDelete()
{
return in_array('delete', $this->definition['cascade']);
{
return $this->definition['local'];
}
-
+
final public function getLocalFieldName()
{
return $this->definition['localTable']->getFieldName($this->definition['local']);
{
return $this->definition['foreign'];
}
-
+
final public function getForeignFieldName()
{
return $this->definition['table']->getFieldName($this->definition['foreign']);