|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00027 require_once 'Zend/Gdata/App/MediaSource.php'; 00028 00038 abstract class Zend_Gdata_App_BaseMediaSource implements Zend_Gdata_App_MediaSource 00039 { 00040 00046 protected $_contentType = null; 00047 00055 protected $_slug = null; 00056 00062 public function getContentType() 00063 { 00064 return $this->_contentType; 00065 } 00066 00073 public function setContentType($value) 00074 { 00075 $this->_contentType = $value; 00076 return $this; 00077 } 00078 00085 public function getSlug(){ 00086 return $this->_slug; 00087 } 00088 00096 public function setSlug($value){ 00097 $this->_slug = $value; 00098 return $this; 00099 } 00100 00101 00111 public function __get($name) 00112 { 00113 $method = 'get'.ucfirst($name); 00114 if (method_exists($this, $method)) { 00115 return call_user_func(array(&$this, $method)); 00116 } else if (property_exists($this, "_${name}")) { 00117 return $this->{'_' . $name}; 00118 } else { 00119 require_once 'Zend/Gdata/App/InvalidArgumentException.php'; 00120 throw new Zend_Gdata_App_InvalidArgumentException( 00121 'Property ' . $name . ' does not exist'); 00122 } 00123 } 00124 00135 public function __set($name, $val) 00136 { 00137 $method = 'set'.ucfirst($name); 00138 if (method_exists($this, $method)) { 00139 return call_user_func(array(&$this, $method), $val); 00140 } else if (isset($this->{'_' . $name}) || ($this->{'_' . $name} === null)) { 00141 $this->{'_' . $name} = $val; 00142 } else { 00143 require_once 'Zend/Gdata/App/InvalidArgumentException.php'; 00144 throw new Zend_Gdata_App_InvalidArgumentException( 00145 'Property ' . $name . ' does not exist'); 00146 } 00147 } 00148 00154 public function __isset($name) 00155 { 00156 $rc = new ReflectionClass(get_class($this)); 00157 $privName = '_' . $name; 00158 if (!($rc->hasProperty($privName))) { 00159 require_once 'Zend/Gdata/App/InvalidArgumentException.php'; 00160 throw new Zend_Gdata_App_InvalidArgumentException( 00161 'Property ' . $name . ' does not exist'); 00162 } else { 00163 if (isset($this->{$privName})) { 00164 if (is_array($this->{$privName})) { 00165 if (count($this->{$privName}) > 0) { 00166 return true; 00167 } else { 00168 return false; 00169 } 00170 } else { 00171 return true; 00172 } 00173 } else { 00174 return false; 00175 } 00176 } 00177 } 00178 00179 }