[Solar-svn] Revision 2691

pmjones at solarphp.com pmjones at solarphp.com
Mon Aug 13 17:30:08 CDT 2007


Branch: added example Model classes for solar test suite



Added: branches/orm/Solar/Example/Model/TestSolarSpecialCols/Collection.php
===================================================================
--- branches/orm/Solar/Example/Model/TestSolarSpecialCols/Collection.php	                        (rev 0)
+++ branches/orm/Solar/Example/Model/TestSolarSpecialCols/Collection.php	2007-08-13 22:30:08 UTC (rev 2691)
@@ -0,0 +1,3 @@
+<?php
+class Solar_Example_Model_TestSolarSpecialCols_Collection extends Solar_Sql_Model_Collection {
+}
\ No newline at end of file

Added: branches/orm/Solar/Example/Model/TestSolarSpecialCols/Record.php
===================================================================
--- branches/orm/Solar/Example/Model/TestSolarSpecialCols/Record.php	                        (rev 0)
+++ branches/orm/Solar/Example/Model/TestSolarSpecialCols/Record.php	2007-08-13 22:30:08 UTC (rev 2691)
@@ -0,0 +1,3 @@
+<?php
+class Solar_Example_Model_TestSolarSpecialCols_Record extends Solar_Sql_Model_Record {
+}
\ No newline at end of file

Added: branches/orm/Solar/Example/Model/TestSolarSpecialCols/Setup/table_cols.php
===================================================================
--- branches/orm/Solar/Example/Model/TestSolarSpecialCols/Setup/table_cols.php	                        (rev 0)
+++ branches/orm/Solar/Example/Model/TestSolarSpecialCols/Setup/table_cols.php	2007-08-13 22:30:08 UTC (rev 2691)
@@ -0,0 +1,113 @@
+<?php
+return array (
+  'id' => 
+  array (
+    'name' => 'id',
+    'type' => 'int',
+    'size' => NULL,
+    'scope' => NULL,
+    'default' => NULL,
+    'require' => true,
+    'primary' => true,
+    'autoinc' => true,
+  ),
+  'created' => 
+  array (
+    'name' => 'created',
+    'type' => 'timestamp',
+    'size' => NULL,
+    'scope' => NULL,
+    'default' => NULL,
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'updated' => 
+  array (
+    'name' => 'updated',
+    'type' => 'timestamp',
+    'size' => NULL,
+    'scope' => NULL,
+    'default' => NULL,
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'seq_foo' => 
+  array (
+    'name' => 'seq_foo',
+    'type' => 'int',
+    'size' => NULL,
+    'scope' => NULL,
+    'default' => NULL,
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'seq_bar' => 
+  array (
+    'name' => 'seq_bar',
+    'type' => 'int',
+    'size' => NULL,
+    'scope' => NULL,
+    'default' => NULL,
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'inherit' => 
+  array (
+    'name' => 'inherit',
+    'type' => 'varchar',
+    'size' => 30,
+    'scope' => NULL,
+    'default' => NULL,
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'name' => 
+  array (
+    'name' => 'name',
+    'type' => 'varchar',
+    'size' => 255,
+    'scope' => NULL,
+    'default' => NULL,
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'email' => 
+  array (
+    'name' => 'email',
+    'type' => 'varchar',
+    'size' => 255,
+    'scope' => NULL,
+    'default' => NULL,
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'uri' => 
+  array (
+    'name' => 'uri',
+    'type' => 'varchar',
+    'size' => 255,
+    'scope' => NULL,
+    'default' => NULL,
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'serialize' => 
+  array (
+    'name' => 'serialize',
+    'type' => 'clob',
+    'size' => NULL,
+    'scope' => NULL,
+    'default' => NULL,
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+);
\ No newline at end of file

Added: branches/orm/Solar/Example/Model/TestSolarSpecialCols/Setup/table_name.php
===================================================================
--- branches/orm/Solar/Example/Model/TestSolarSpecialCols/Setup/table_name.php	                        (rev 0)
+++ branches/orm/Solar/Example/Model/TestSolarSpecialCols/Setup/table_name.php	2007-08-13 22:30:08 UTC (rev 2691)
@@ -0,0 +1,2 @@
+<?php
+return 'test_solar_special_cols';
\ No newline at end of file

Added: branches/orm/Solar/Example/Model/TestSolarSpecialCols.php
===================================================================
--- branches/orm/Solar/Example/Model/TestSolarSpecialCols.php	                        (rev 0)
+++ branches/orm/Solar/Example/Model/TestSolarSpecialCols.php	2007-08-13 22:30:08 UTC (rev 2691)
@@ -0,0 +1,26 @@
+<?php
+class Solar_Example_Model_TestSolarSpecialCols extends Solar_Sql_Model {
+    
+    protected function _setup()
+    {
+        $dir = str_replace('_', DIRECTORY_SEPARATOR, $this->_class)
+             . DIRECTORY_SEPARATOR
+             . 'Setup'
+             . DIRECTORY_SEPARATOR;
+        
+        $this->_table_name = Solar::run($dir . 'table_name.php');
+        $this->_table_cols = Solar::run($dir . 'table_cols.php');
+        
+        $this->_primary_col = 'id';
+        $this->_created_col = 'created';
+        $this->_updated_col = 'updated';
+        $this->_inherit_col = 'inherit';
+        
+        $this->_sequence_cols = array(
+            'seq_foo' => 'test_solar_foo',
+            'seq_bar' => 'test_solar_bar',
+        );
+        
+        $this->_serialize_cols = 'serialize';
+    }
+}
\ No newline at end of file

Added: branches/orm/Solar/Example/Model/TestSolarSqlDescribe/Collection.php
===================================================================
--- branches/orm/Solar/Example/Model/TestSolarSqlDescribe/Collection.php	                        (rev 0)
+++ branches/orm/Solar/Example/Model/TestSolarSqlDescribe/Collection.php	2007-08-13 22:30:08 UTC (rev 2691)
@@ -0,0 +1,3 @@
+<?php
+class Solar_Example_Model_TestSolarSqlDescribe_Collection extends Solar_Sql_Model_Collection {
+}
\ No newline at end of file

Added: branches/orm/Solar/Example/Model/TestSolarSqlDescribe/Record.php
===================================================================
--- branches/orm/Solar/Example/Model/TestSolarSqlDescribe/Record.php	                        (rev 0)
+++ branches/orm/Solar/Example/Model/TestSolarSqlDescribe/Record.php	2007-08-13 22:30:08 UTC (rev 2691)
@@ -0,0 +1,3 @@
+<?php
+class Solar_Example_Model_TestSolarSqlDescribe_Record extends Solar_Sql_Model_Record {
+}
\ No newline at end of file

Added: branches/orm/Solar/Example/Model/TestSolarSqlDescribe/Setup/table_cols.php
===================================================================
--- branches/orm/Solar/Example/Model/TestSolarSqlDescribe/Setup/table_cols.php	                        (rev 0)
+++ branches/orm/Solar/Example/Model/TestSolarSqlDescribe/Setup/table_cols.php	2007-08-13 22:30:08 UTC (rev 2691)
@@ -0,0 +1,223 @@
+<?php
+return array (
+  'test_autoinc_primary' => 
+  array (
+    'name' => 'test_autoinc_primary',
+    'type' => 'int',
+    'size' => NULL,
+    'scope' => NULL,
+    'default' => NULL,
+    'require' => true,
+    'primary' => true,
+    'autoinc' => true,
+  ),
+  'test_require' => 
+  array (
+    'name' => 'test_require',
+    'type' => 'int',
+    'size' => NULL,
+    'scope' => NULL,
+    'default' => '',
+    'require' => true,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'test_bool' => 
+  array (
+    'name' => 'test_bool',
+    'type' => 'bool',
+    'size' => NULL,
+    'scope' => NULL,
+    'default' => NULL,
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'test_char' => 
+  array (
+    'name' => 'test_char',
+    'type' => 'char',
+    'size' => 3,
+    'scope' => NULL,
+    'default' => NULL,
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'test_varchar' => 
+  array (
+    'name' => 'test_varchar',
+    'type' => 'varchar',
+    'size' => 7,
+    'scope' => NULL,
+    'default' => NULL,
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'test_smallint' => 
+  array (
+    'name' => 'test_smallint',
+    'type' => 'smallint',
+    'size' => NULL,
+    'scope' => NULL,
+    'default' => NULL,
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'test_int' => 
+  array (
+    'name' => 'test_int',
+    'type' => 'int',
+    'size' => NULL,
+    'scope' => NULL,
+    'default' => NULL,
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'test_bigint' => 
+  array (
+    'name' => 'test_bigint',
+    'type' => 'bigint',
+    'size' => NULL,
+    'scope' => NULL,
+    'default' => NULL,
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'test_numeric_size' => 
+  array (
+    'name' => 'test_numeric_size',
+    'type' => 'numeric',
+    'size' => 7,
+    'scope' => NULL,
+    'default' => NULL,
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'test_numeric_scope' => 
+  array (
+    'name' => 'test_numeric_scope',
+    'type' => 'numeric',
+    'size' => 7,
+    'scope' => 3,
+    'default' => NULL,
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'test_float' => 
+  array (
+    'name' => 'test_float',
+    'type' => 'float',
+    'size' => NULL,
+    'scope' => NULL,
+    'default' => NULL,
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'test_clob' => 
+  array (
+    'name' => 'test_clob',
+    'type' => 'clob',
+    'size' => NULL,
+    'scope' => NULL,
+    'default' => NULL,
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'test_date' => 
+  array (
+    'name' => 'test_date',
+    'type' => 'date',
+    'size' => NULL,
+    'scope' => NULL,
+    'default' => NULL,
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'test_time' => 
+  array (
+    'name' => 'test_time',
+    'type' => 'time',
+    'size' => NULL,
+    'scope' => NULL,
+    'default' => NULL,
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'test_timestamp' => 
+  array (
+    'name' => 'test_timestamp',
+    'type' => 'timestamp',
+    'size' => NULL,
+    'scope' => NULL,
+    'default' => NULL,
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'test_default_null' => 
+  array (
+    'name' => 'test_default_null',
+    'type' => 'char',
+    'size' => 3,
+    'scope' => NULL,
+    'default' => NULL,
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'test_default_string' => 
+  array (
+    'name' => 'test_default_string',
+    'type' => 'varchar',
+    'size' => 7,
+    'scope' => NULL,
+    'default' => 'literal',
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'test_default_integer' => 
+  array (
+    'name' => 'test_default_integer',
+    'type' => 'int',
+    'size' => NULL,
+    'scope' => NULL,
+    'default' => '7',
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'test_default_numeric' => 
+  array (
+    'name' => 'test_default_numeric',
+    'type' => 'numeric',
+    'size' => 7,
+    'scope' => 3,
+    'default' => '1234.567',
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+  'test_default_ignore' => 
+  array (
+    'name' => 'test_default_ignore',
+    'type' => 'int',
+    'size' => NULL,
+    'scope' => NULL,
+    'default' => NULL,
+    'require' => false,
+    'primary' => false,
+    'autoinc' => false,
+  ),
+);
\ No newline at end of file

Added: branches/orm/Solar/Example/Model/TestSolarSqlDescribe/Setup/table_name.php
===================================================================
--- branches/orm/Solar/Example/Model/TestSolarSqlDescribe/Setup/table_name.php	                        (rev 0)
+++ branches/orm/Solar/Example/Model/TestSolarSqlDescribe/Setup/table_name.php	2007-08-13 22:30:08 UTC (rev 2691)
@@ -0,0 +1,2 @@
+<?php
+return 'test_solar_sql_describe';
\ No newline at end of file

Added: branches/orm/Solar/Example/Model/TestSolarSqlDescribe.php
===================================================================
--- branches/orm/Solar/Example/Model/TestSolarSqlDescribe.php	                        (rev 0)
+++ branches/orm/Solar/Example/Model/TestSolarSqlDescribe.php	2007-08-13 22:30:08 UTC (rev 2691)
@@ -0,0 +1,14 @@
+<?php
+class Solar_Example_Model_TestSolarSqlDescribe extends Solar_Sql_Model {
+    
+    protected function _setup()
+    {
+        $dir = str_replace('_', DIRECTORY_SEPARATOR, $this->_class)
+             . DIRECTORY_SEPARATOR
+             . 'Setup'
+             . DIRECTORY_SEPARATOR;
+        
+        $this->_table_name = Solar::run($dir . 'table_name.php');
+        $this->_table_cols = Solar::run($dir . 'table_cols.php');
+    }
+}
\ No newline at end of file




More information about the Solar-svn mailing list