r1218 - in trunk: core/DB core/OSQL doc

From: <voxusAT@ATshadanakar.org>
Date: Fri, 27 Jan 2006 00:51:52 +0300 (MSK)

Author: voxus
Date: 2006-01-27 00:51:51 +0300 (Fri, 27 Jan 2006)
New Revision: 1218

Modified:
   trunk/core/DB/Dialect.class.php
   trunk/core/OSQL/InsertOrUpdateQuery.class.php
   trunk/core/OSQL/OSQL.class.php
   trunk/core/OSQL/QuerySkeleton.class.php
   trunk/doc/ChangeLog
   trunk/doc/TODO
Log:
+ OSQL::createTable()

Modified: trunk/core/DB/Dialect.class.php
===================================================================
--- trunk/core/DB/Dialect.class.php 2006-01-26 03:44:05 UTC (rev 1217)
+++ trunk/core/DB/Dialect.class.php 2006-01-26 21:51:51 UTC (rev 1218)
@@ -53,6 +53,11 @@
                         return "CAST ({$field} AS {$type})";
                 }
                 
+ public static function typeToString(DataType $type)
+ {
+ return $type->getName();
+ }
+
                 public function fieldToString(&$field)
                 {
                         return

Modified: trunk/core/OSQL/InsertOrUpdateQuery.class.php
===================================================================
--- trunk/core/OSQL/InsertOrUpdateQuery.class.php 2006-01-26 03:44:05 UTC (rev 1217)
+++ trunk/core/OSQL/InsertOrUpdateQuery.class.php 2006-01-26 21:51:51 UTC (rev 1218)
@@ -37,7 +37,7 @@
                         return $this;
                 }
                 
- public function setId($field, /* Identifiable */ $object = null)
+ public function lazySet($field, /* Identifiable */ $object = null)
                 {
                         if ($object instanceof Identifiable)
                                 $this->set($field, $object->getId());

Modified: trunk/core/OSQL/OSQL.class.php
===================================================================
--- trunk/core/OSQL/OSQL.class.php 2006-01-26 03:44:05 UTC (rev 1217)
+++ trunk/core/OSQL/OSQL.class.php 2006-01-26 21:51:51 UTC (rev 1218)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- * Copyright (C) 2004-2005 by Konstantin V. Arkhipov *
+ * Copyright (C) 2004-2006 by Konstantin V. Arkhipov *
  * voxusAT@ATonphp.org *
  * *
  * This program is free software; you can redistribute it and/or modify *
@@ -37,5 +37,10 @@
                 {
                         return new DeleteQuery();
                 }
+
+ public static function createTable(DBTable $table)
+ {
+ return new CreateTableQuery($table);
+ }
         }
 ?>
\ No newline at end of file

Modified: trunk/core/OSQL/QuerySkeleton.class.php
===================================================================
--- trunk/core/OSQL/QuerySkeleton.class.php 2006-01-26 03:44:05 UTC (rev 1217)
+++ trunk/core/OSQL/QuerySkeleton.class.php 2006-01-26 21:51:51 UTC (rev 1218)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- * Copyright (C) 2004-2005 by Konstantin V. Arkhipov *
+ * Copyright (C) 2004-2006 by Konstantin V. Arkhipov *
  * voxusAT@ATonphp.org *
  * *
  * This program is free software; you can redistribute it and/or modify *
@@ -14,26 +14,11 @@
         /**
          * @ingroup OSQL
         **/
- abstract class QuerySkeleton implements Query
+ abstract class QuerySkeleton extends QueryIdentification
         {
                 protected $where = array(); // where clauses
                 protected $whereLogic = array(); // logic between where's
 
- public function getId()
- {
- static $dialect = null;
-
- if ($dialect === null)
- $dialect = new ImaginaryDialect();
-
- return sha1($this->toString($dialect));
- }
-
- public function setId($id)
- {
- throw new UnsupportedMethodException();
- }
-
                 public function where(LogicalObject $exp, $logic = null)
                 {
                         if ($this->where && !$logic)

Modified: trunk/doc/ChangeLog
===================================================================
--- trunk/doc/ChangeLog 2006-01-26 03:44:05 UTC (rev 1217)
+++ trunk/doc/ChangeLog 2006-01-26 21:51:51 UTC (rev 1218)
@@ -1,5 +1,12 @@
 # $Id$
 
+2006-01-26 Konstantin V. Arkhipov <voxusAT@ATshadanakar.org>
+
+ * core/OSQL/InsertOrUpdateQuery.class.php: setId() renamed to
+ lazySet() to avoid collision with Query interface.
+
+ * core/OSQL/: basic support for table creation implemented.
+
 2006-01-25 Sveta Smirnova <svetaAT@ATmicrobecal.com>
 
         * core/OSQL/: schema's support introduced in several common cases.

Modified: trunk/doc/TODO
===================================================================
--- trunk/doc/TODO 2006-01-26 03:44:05 UTC (rev 1217)
+++ trunk/doc/TODO 2006-01-26 21:51:51 UTC (rev 1218)
@@ -3,4 +3,4 @@
 * implement separate OrderBy chain-like class which should be able to perform
   self transformations accoring to given mapping. As suggested by Anton.
 
-* implement create{Table,Sequence} @ OSQL.
+* implement createSequence @ OSQL.
Received on Fri Jan 27 2006 - 00:51:52 MSK

This archive was generated by hypermail 2.2.0 : Sat Oct 27 2007 - 19:45:16 MSD