dmBridge PHP API
DMAbstractSocialEntity.php
00001 <?php
00002 #
00003 # dmBridge: a data access framework for CONTENTdm(R)
00004 #
00005 # Copyright © 2009, 2010 Board of Regents of the Nevada System of Higher
00006 # Education, on behalf of the University of Nevada, Las Vegas
00007 #
00008 
00015 abstract class DMAbstractSocialEntity extends DMModel {
00016 
00018    private $id;
00020    private $is_approved = false;
00022    private $object;
00024    private $timestamp;
00026    protected $value;
00027 
00036    public function __construct() {
00037       $this->setTimestamp(new DMDateTime());
00038    }
00039 
00043    public function __toString() {
00044       return (string) $this->getValue();
00045    }
00046 
00050    public final function isApproved() {
00051       return $this->is_approved;
00052    }
00053 
00057    public final function setApproved($bool) {
00058       $this->is_approved = ($bool);
00059    }
00060 
00064    public final function getID() {
00065       return $this->id;
00066    }
00067 
00071    public final function setID($id) {
00072       $this->id = (int) $id;
00073    }
00074 
00079    public function getObject() {
00080       return $this->object;
00081    }
00082 
00090    public function setObject(DMObject $object) {
00091       $this->object = $object;
00092    }
00093 
00097    public final function getTimestamp() {
00098       return $this->timestamp;
00099    }
00100 
00104    public final function setTimestamp(DMDateTime $datetime) {
00105       $this->timestamp = $datetime;
00106    }
00107 
00111    public function getValue() {
00112       return $this->value;
00113    }
00114 
00119    public function setValue($str) {
00120       if (strlen($str) < 2) {
00121          throw new DMIllegalArgumentException(
00122             sprintf(DMLocalizedString::getString('STRING_TOO_SHORT'), 'Value', 2));
00123       }
00124       $this->value = $str;
00125    }
00126 
00127 }
 All Data Structures Functions Variables