This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "quickfw".
The branch, master has been updated
via 2abeb977bdbd63c9e7f7b88598ef640732110795 (commit)
from f7c33ff284b9d0ecfc96127fd4bac96dfc536b71 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 2abeb977bdbd63c9e7f7b88598ef640732110795
Author: Ivan1986 <iva...@li...>
Date: Tue May 25 13:34:43 2010 +0400
Поддержка проверки null в зависимом поле
diff --git a/lib/Modules/Scafold/Fields.php b/lib/Modules/Scafold/Fields.php
index cc6dd17..2f4f056 100644
--- a/lib/Modules/Scafold/Fields.php
+++ b/lib/Modules/Scafold/Fields.php
@@ -213,10 +213,14 @@ class Scafold_Foreign extends Scafold_Field
/** @var array Зависимые поля */
protected $lookup;
+ /** @var bool Может ли быть нулевое значение */
+ protected $isnull;
+
public function __construct($info, $where = DBSIMPLE_SKIP)
{
if (!empty($info->typeParams))
$where = $info->typeParams;
+ $this->isnull = $info->foreign['null'];
parent::__construct($info);
$this->lookup = QFW::$db->selectCol('SELECT ?# AS ARRAY_KEY_1, ?# FROM ?# {WHERE ?s}',
$info->foreign['key'], $info->foreign['field'], $info->foreign['table'], $where);
@@ -227,6 +231,11 @@ class Scafold_Foreign extends Scafold_Field
return $this->selectBuild($this->lookup, $value);
}
+ public function validator($id, $value)
+ {
+ return $this->isnull || !empty($value);
+ }
+
}
/**
-----------------------------------------------------------------------
Summary of changes:
lib/Modules/Scafold/Fields.php | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
hooks/post-receive
--
quickfw
|