SelectivePeer.class.php

Go to the documentation of this file.
00001 <?php
00002 /***************************************************************************
00003  *   Copyright (C) 2005-2007 by Konstantin V. Arkhipov                     *
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 
00015     abstract class SelectivePeer extends CachePeer
00016     {
00017         const MARGINAL_VALUE = 'i_am_declassed_element'; // Yanka R.I.P.
00018         
00019         protected $className    = null;
00020         
00024         public function mark($className)
00025         {
00026             $this->className = $className;
00027             return $this;
00028         }
00029         
00030         protected function getClassName()
00031         {
00032             if (!$this->className)
00033                 $class = self::MARGINAL_VALUE;
00034             else
00035                 $class = $this->className;
00036                 
00037             $this->className = null; // eat it after use
00038 
00039             return $class;
00040         }
00041     }
00042 ?>