IdentifiableObject.class.php

Go to the documentation of this file.
00001 <?php
00002 /***************************************************************************
00003  *   Copyright (C) 2005-2007 by Garmonbozia Research Group                 *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU Lesser General Public License as        *
00007  *   published by the Free Software Foundation; either version 3 of the    *
00008  *   License, or (at your option) any later version.                       *
00009  *                                                                         *
00010  ***************************************************************************/
00011 /* $Id: IdentifiableObject.class.php 4687 2007-12-09 18:57:18Z voxus $ */
00012 
00021     class /* spirit of */ IdentifiableObject implements Identifiable
00022     {
00023         protected $id = null;
00024         
00028         public static function wrap($id)
00029         {
00030             $io = new self;
00031             
00032             return $io->setId($id);
00033         }
00034         
00035         public function getId()
00036         {
00037             if (
00038                 $this->id instanceof Identifier
00039                 && $this->id->isFinalized()
00040             )
00041                 return $this->id->getId();
00042             else
00043                 return $this->id;
00044         }
00045         
00049         public function setId($id)
00050         {
00051             $this->id = $id;
00052             
00053             return $this;
00054         }
00055     }
00056 ?>

Generated on Sun Dec 9 21:56:22 2007 for onPHP by  doxygen 1.5.4