Source for file OnpubImage.php

Documentation is available at OnpubImage.php

  1. <?php
  2.  
  3. /**
  4.  * An image.
  5.  *
  6.  * @author {@link mailto:corey@onpub.com Corey H.M. Taylor}
  7.  * @copyright Onpub (TM). Copyright 2012, Onpub.com.
  8.  *  {@link http://onpub.com/}
  9.  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
  10.  *  Version 2
  11.  * @package OnpubAPI
  12.  */
  13. class OnpubImage
  14. {
  15.   /**
  16.    * Image ID. Default is NULL.
  17.    *
  18.    * @var int 
  19.    */
  20.   public $ID;
  21.   /**
  22.    * Website ID. Default is NULL.
  23.    *
  24.    * @var int 
  25.    */
  26.   public $websiteID;
  27.   /**
  28.    * Image file name. Default is an empty string.
  29.    *
  30.    * @var string 
  31.    */
  32.   public $fileName;
  33.   /**
  34.    * Image description. Default is an empty string.
  35.    *
  36.    * @var string 
  37.    */
  38.   public $description;
  39.   /**
  40.    * Image URL. Default is an empty string.
  41.    *
  42.    * @var string 
  43.    */
  44.   public $url;
  45.   private $created;
  46.   private $modified;
  47.   /**
  48.    * Image website. Default is NULL.
  49.    *
  50.    * @var OnpubWebsite 
  51.    */
  52.   public $website;
  53.  
  54.   function __construct()
  55.   {
  56.     $this->ID = NULL;
  57.     $this->websiteID = NULL;
  58.     $this->fileName = "";
  59.     $this->description = "";
  60.     $this->url = "";
  61.     $this->created NULL;
  62.     $this->modified NULL;
  63.     $this->website = NULL;
  64.   }
  65.  
  66.   /**
  67.    * Get this image's creation date.
  68.    *
  69.    * By default, returns the date at the time this method was called for the
  70.    * first time. Call {@link OnpubImage::setCreated()} to explicitly set
  71.    * this image's creation date.
  72.    *
  73.    * @return DateTime 
  74.    */
  75.   public function getCreated()
  76.   {
  77.     if ($this->created === NULL{
  78.       $this->created new DateTime();
  79.     }
  80.  
  81.     return $this->created;
  82.   }
  83.  
  84.   /**
  85.    * @param DateTime 
  86.    */
  87.   public function setCreated(DateTime $created)
  88.   {
  89.     $this->created $created;
  90.   }
  91.  
  92.   /**
  93.    * Get this image's last modification date.
  94.    *
  95.    * By default, returns the date at the time this method was called for the
  96.    * first time. Call {@link OnpubImage::setModified()} to explicitly set
  97.    * this image's last modification date.
  98.    *
  99.    * @return DateTime 
  100.    */
  101.   public function getModified()
  102.   {
  103.     if ($this->modified === NULL{
  104.       $this->modified new DateTime();
  105.     }
  106.  
  107.     return $this->modified;
  108.   }
  109.  
  110.   /**
  111.    * @param DateTime 
  112.    */
  113.   public function setModified(DateTime $modified)
  114.   {
  115.     $this->modified $modified;
  116.   }
  117.  
  118.   public function getFullPath()
  119.   {
  120.     return addTrailingSlash($this->website->imagesDirectory$this->fileName;
  121.   }
  122. }
  123. ?>

Documentation generated on Fri, 08 Feb 2013 04:02:20 -0500 by phpDocumentor 1.4.4