home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / php / PEAR / Services / Blogging / MediaObject.php < prev    next >
Encoding:
PHP Script  |  2008-07-02  |  1.4 KB  |  51 lines

  1. <?php
  2. /**
  3. * Media object (image, video, sound) in a blog entry.
  4. * Not used currently.
  5. *
  6. * @category Services
  7. * @package  Services_Blogging
  8. * @author   Anant Narayanan <anant@php.net>
  9. * @author   Christian Weiske <cweiske@php.net>
  10. * @license  http://www.gnu.org/copyleft/lesser.html  LGPL License 2.1
  11. * @link     http://pear.php.net/package/Services_Blogging
  12. */
  13. class Services_Blogging_MediaObject
  14. {
  15.     const ERROR_INVALID_PROPERTY = 181;
  16.  
  17.     protected $values = array(
  18.         'name'      => null,
  19.         'mimetype'  => null,
  20.         'filename'  => null
  21.     );
  22.  
  23.  
  24.     public function __set($strProperty, $value)
  25.     {
  26.         if (!isset($this->values[$strProperty])) {
  27.             require_once 'Services/Blogging/Exception.php';
  28.             throw new Services_Blogging_Exception(
  29.                 'Invalid property "' . $strProperty . '"',
  30.                 self::ERROR_INVALID_PROPERTY
  31.             );
  32.         }
  33.         $this->values[$strProperty] = $value;
  34.     }//public function __set($strProperty, $value)
  35.  
  36.  
  37.  
  38.     public function __get($strProperty)
  39.     {
  40.         if (!isset($this->values[$strProperty])) {
  41.             require_once 'Services/Blogging/Exception.php';
  42.             throw new Services_Blogging_Exception(
  43.                 'Invalid property "' . $strProperty . '"',
  44.                 self::ERROR_INVALID_PROPERTY
  45.             );
  46.         }
  47.         return $this->values[$strProperty];
  48.     }//public function __get($strProperty)
  49.  
  50. }//class Services_Blogging_MediaObject
  51. ?>