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 f98f38f5b9ba1e568ffc727a27d5b8b41837815e (commit)
from 9f1f2fd43e09892aed409ff398620b0926f6bf1b (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 f98f38f5b9ba1e568ffc727a27d5b8b41837815e
Author: Ivan1986 <iva...@li...>
Date: Thu May 13 13:27:46 2010 +0400
Добавлены поля для Int и Varchar/Char в скафолдинг
diff --git a/lib/Modules/Scafold/Fields.php b/lib/Modules/Scafold/Fields.php
index c3b85d4..533c810 100644
--- a/lib/Modules/Scafold/Fields.php
+++ b/lib/Modules/Scafold/Fields.php
@@ -278,6 +278,42 @@ class Scafold_Text extends Scafold_UserInput
}
/**
+ * Класс для типа Int
+ */
+class Scafold_Int extends Scafold_Field
+{
+ public function validator($id, $value)
+ {
+ return is_numeric($value);
+ }
+}
+
+/**
+ * Класс для типа Varchar
+ */
+class Scafold_Varchar extends Scafold_Field
+{
+ /** @var integer размер поля в базе */
+ private $size;
+
+ public function __construct($info, $size)
+ {
+ parent::__construct($info);
+ $this->size = $size;
+ }
+
+ public function validator($id, $value)
+ {
+ return mb_strlen($value) <= $this->size;
+ }
+}
+
+/**
+ * Класс для типа Char - полностью аналогичен Varchar
+ */
+class Scafold_Char extends Scafold_Varchar {}
+
+/**
* Класс для типа ENUM
*/
class Scafold_Enum extends Scafold_Field
-----------------------------------------------------------------------
Summary of changes:
lib/Modules/Scafold/Fields.php | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
hooks/post-receive
--
quickfw
|