[Solar-svn] Revision 2745

pmjones at solarphp.com pmjones at solarphp.com
Sat Sep 8 11:37:42 CDT 2007


branch: Solar_Model*: various fixes

* [NEW] Classes for Solar_Model_Record (a base record class), Solar_Model_Nodes_Record, Solar_Model_Nodes_Bookmark_Record (with new form() method)

* [CHG] Solar_Model_Nodes_Bookmarks now filters validateNotBlank() on the URI

* [FIX] Solar_Model_Nodes now does validateUnique() on the 'inherit' col, vice the no-longer-existing 'model' col




Added: branches/orm/Solar/Model/Nodes/Bookmarks/Locale/en_US.php
===================================================================
--- branches/orm/Solar/Model/Nodes/Bookmarks/Locale/en_US.php	                        (rev 0)
+++ branches/orm/Solar/Model/Nodes/Bookmarks/Locale/en_US.php	2007-09-08 16:37:42 UTC (rev 2745)
@@ -0,0 +1,7 @@
+<?php
+return array(
+    'LABEL_URI' => 'Location',
+    'LABEL_SUBJ' => 'Title',
+    'LABEL_SUMM' => 'Description',
+    'LABEL_POS'  => 'Rank',
+);
\ No newline at end of file

Added: branches/orm/Solar/Model/Nodes/Bookmarks/Record.php
===================================================================
--- branches/orm/Solar/Model/Nodes/Bookmarks/Record.php	                        (rev 0)
+++ branches/orm/Solar/Model/Nodes/Bookmarks/Record.php	2007-09-08 16:37:42 UTC (rev 2745)
@@ -0,0 +1,32 @@
+<?php
+class Solar_Model_Nodes_Bookmarks_Record extends Solar_Model_Nodes_Record {
+    public function form($cols = null)
+    {
+        // force the columns to be shown in the form
+        $cols = array(
+            'uri'  => array(
+                'attribs' => array(
+                    'size' => 48,
+                ),
+            ),
+            'subj' => array(
+                'attribs' => array(
+                    'size' => 48,
+                ),
+            ),
+            'summ' => array(
+                'type'    => 'textarea',
+                'attribs' => array(
+                    'rows' => 6,
+                    'cols'  => 48,
+                ),
+            ),
+            'pos'  => array(
+                'attribs' => array(
+                    'size' => 3,
+                ),
+            ),
+        );
+        return parent::form($cols);
+    }
+}
\ No newline at end of file

Modified: branches/orm/Solar/Model/Nodes/Bookmarks.php
===================================================================
--- branches/orm/Solar/Model/Nodes/Bookmarks.php	2007-09-08 16:34:02 UTC (rev 2744)
+++ branches/orm/Solar/Model/Nodes/Bookmarks.php	2007-09-08 16:37:42 UTC (rev 2745)
@@ -1,3 +1,8 @@
 <?php
 class Solar_Model_Nodes_Bookmarks extends Solar_Model_Nodes {
+    protected function _setup()
+    {
+        parent::_setup();
+        $this->_addFilter('uri', 'validateNotBlank');
+    }
 }

Added: branches/orm/Solar/Model/Nodes/Record.php
===================================================================
--- branches/orm/Solar/Model/Nodes/Record.php	                        (rev 0)
+++ branches/orm/Solar/Model/Nodes/Record.php	2007-09-08 16:37:42 UTC (rev 2745)
@@ -0,0 +1,2 @@
+<?php
+class Solar_Model_Nodes_Record extends Solar_Model_Record {}
\ No newline at end of file

Modified: branches/orm/Solar/Model/Nodes.php
===================================================================
--- branches/orm/Solar/Model/Nodes.php	2007-09-08 16:34:02 UTC (rev 2744)
+++ branches/orm/Solar/Model/Nodes.php	2007-09-08 16:37:42 UTC (rev 2745)
@@ -111,7 +111,7 @@
         // make sure the name is unique for its area and model
         $where = array(
             'id != :id',
-            'model = :model',
+            'inherit = :inherit',
             'area_id = :area_id',
         );
         $this->_addFilter('name', 'validateUnique', $where);

Added: branches/orm/Solar/Model/Record.php
===================================================================
--- branches/orm/Solar/Model/Record.php	                        (rev 0)
+++ branches/orm/Solar/Model/Record.php	2007-09-08 16:37:42 UTC (rev 2745)
@@ -0,0 +1,2 @@
+<?php
+class Solar_Model_Record extends Solar_Sql_Model_Record {}
\ No newline at end of file




More information about the Solar-svn mailing list