dmBridge PHP API
DMTag.php
00001 <?php
00002 #
00003 # dmBridge: a data access framework for CONTENTdm(R)
00004 #
00005 # Copyright © 2009, 2010, 2011 Board of Regents of the Nevada System of Higher
00006 # Education, on behalf of the University of Nevada, Las Vegas
00007 #
00008 
00015 class DMTag extends DMAbstractSocialEntity implements DMURIAddressable,
00016       DMSocialEntity {
00017 
00018    const MIN_LENGTH = 1;
00019    const MAX_LENGTH = 50;
00020 
00025    public function getURI() {
00026       return DMInternalURI::getResourceURI(
00027             DMBridgeComponent::HTTPAPI,
00028             'tags/' . $this->getID());
00029    }
00030 
00036    public function setValue($str) {
00037       if (strlen($str) < 1) {
00038          throw new DMIllegalArgumentException(
00039             sprintf(DMLocalizedString::getString('TAG_VALUE_TOO_SHORT'),
00040                self::MIN_LENGTH));
00041       } else if (strlen($str) > self::MAX_LENGTH) {
00042          throw new DMIllegalArgumentException(
00043             sprintf(DMLocalizedString::getString('TAG_VALUE_TOO_LONG'),
00044                self::MAX_LENGTH));
00045       }
00046       $this->value = (string) $str;
00047    }
00048 
00049 }
 All Data Structures Functions Variables