dmBridge PHP API
DMAbstractViewer.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 
00016 abstract class DMAbstractViewer {
00017 
00019    private $helper;
00021    private $object;
00023    private $media_type;
00025    private $width;
00027    private $height;
00028 
00029 
00036    public function __construct(DMObject $obj, DMMediaType $media_type, $width,
00037          $height) {
00038       $this->setObject($obj);
00039       $this->setMediaType($media_type);
00040       $this->setWidth($width);
00041       $this->setHeight($height);
00042    }
00043 
00050    public function viewerWillRender() {
00051    }
00052 
00056    protected function getHelper() {
00057       return $this->helper;
00058    }
00059 
00063    public function setHelper(DMGenericTemplateHelper $helper) {
00064       $this->helper = $helper;
00065    }
00066 
00070    protected function getMediaType() {
00071       return $this->media_type;
00072    }
00073 
00077    public function setMediaType(DMMediaType $media_type) {
00078       $this->media_type = $media_type;
00079    }
00080 
00084    protected function getObject() {
00085       return $this->object;
00086    }
00087 
00091    public function setObject(DMObject $obj) {
00092       $this->object = $obj;
00093    }
00094 
00098    protected function getWidth() {
00099       $units = (round($this->width) == $this->width) ? "px" : "";
00100       return $this->width . $units;
00101    }
00102 
00106    public function setWidth($width) {
00107       $this->width = $width;
00108    }
00109 
00113    protected function getHeight() {
00114       $units = (round($this->height) == $this->height) ? "px" : "";
00115       return $this->height . $units;
00116    }
00117 
00121    public function setHeight($height) {
00122       $this->height = $height;
00123    }
00124 
00125 }
 All Data Structures Functions Variables