Author: Tobias Schlitt
Date: 2007-05-04 09:53:03 +0200 (Fri, 04 May 2007)
New Revision: 5036

Log:
- Implemented issue #8487: an Interface for Persistent Objects.
# We possibly need to discuss the name of the interface after the beta release,
# since nobody objected so far I'm commiting for the beta.

Added:
   trunk/PersistentObject/src/interfaces/persistent_object.php
Modified:
   trunk/PersistentObject/ChangeLog

Modified: trunk/PersistentObject/ChangeLog
===================================================================
--- trunk/PersistentObject/ChangeLog    2007-05-04 06:52:55 UTC (rev 5035)
+++ trunk/PersistentObject/ChangeLog    2007-05-04 07:53:03 UTC (rev 5036)
@@ -11,6 +11,7 @@
 - Fixed issue #10369: testAddRelatedBirthdayToPerson3UpdateSuccess fails for 
no.
 - Fixed issue #10112: Lots of failures in PersistentObject tests with pgsql.
 - Implemented issue #10166: Cache PO-definitions
+- Implemented issue #8487: an Interface for Persistent Objects.
        
        
 1.2 - Monday 18 December 2006

Added: trunk/PersistentObject/src/interfaces/persistent_object.php
===================================================================
--- trunk/PersistentObject/src/interfaces/persistent_object.php 2007-05-04 
06:52:55 UTC (rev 5035)
+++ trunk/PersistentObject/src/interfaces/persistent_object.php 2007-05-04 
07:53:03 UTC (rev 5036)
@@ -0,0 +1,44 @@
+<?php
+/**
+ * File containing the ezcPersistentObject interface
+ *
+ * @package PersistentObject
+ * @version //autogen//
+ * @copyright Copyright (C) 2005-2007 eZ systems as. All rights reserved.
+ * @license http://ez.no/licenses/new_bsd New BSD License
+ */
+
+/**
+ * ezcPersistentObject is an (optional) interface for classes that provide 
persistent objects.
+ *
+ * The PersistentObject component does not require a class to inherit from a
+ * certain base class or implement a certain interface to be used with the
+ * component. However, this interface can (optionally) be implemented by your
+ * persistent classes, to ensure they provide all necessary methods.
+ *
+ * @package PersistentObject
+ */
+interface ezcPersistentObject
+{
+    /**
+     * Returns the current state of an object.
+     * This method returns an array representing the current state of the
+     * object. The array must contain a key for every attribute of the
+     * object, assigned to the value of the attribute.
+     * 
+     * @return array(string=>mixed) The state of the object.
+     */
+    public function getState();
+
+    /**
+     * Sets the state of the object.
+     * This method sets the state of the object accoring to a given array,
+     * which must conform to the standards defined at [EMAIL PROTECTED] 
getState()}.
+     * 
+     * @param array $state The new state for the object.
+     * @return void
+     */
+    public function setState( array $state );
+}
+
+?>


Property changes on: trunk/PersistentObject/src/interfaces/persistent_object.php
___________________________________________________________________
Name: svn:eol-style
   + native

-- 
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to