예제 #1
0
파일: AOutput.php 프로젝트: mast3rpee/blw
 /**
  * Dynamic properties.
  *
  * @param string $name
  *            Label of property to set.
  * @param mixed $value
  *            Value of property.
  */
 public function __set($name, $value)
 {
     // Try to set property
     switch ($name) {
         // IMediatable
         case 'Mediator':
             $result = $this->setMediator($value);
             break;
         case 'MediatorID':
             $result = $this->setMediatorID($value);
             break;
             // IOutput
         // IOutput
         case 'stdOut':
         case 'stdErr':
             $result = IDataMapper::READONLY;
             break;
             // Undefined property
         // Undefined property
         default:
             $result = IDataMapper::UNDEFINED;
     }
     // Check results
     if (list($Message, $Level) = ADataMapper::getErrorInfo($result, get_class($this), $name)) {
         trigger_error($Message, $Level);
     }
 }
예제 #2
0
 /**
  * Dynamic properties.
  *
  * @param string $name Label of property to set.
  * @param mixed $value Value of property.
  */
 public function __set($name, $value)
 {
     // Try to set property
     switch ($name) {
         // ISerializable
         case 'Status':
         case 'Serializer':
             // IIterable
         // IIterable
         case 'ID':
             $result = IDataMapper::READONLY;
             break;
         case 'Parent':
             $result = $this->setParent($value);
             break;
             // Undefined property
         // Undefined property
         default:
             $result = IDataMapper::UNDEFINED;
     }
     // Check results
     if (list($Message, $Level) = ADataMapper::getErrorInfo($result, get_class($this), $name)) {
         trigger_error($Message, $Level);
     }
 }
예제 #3
0
파일: AResponse.php 프로젝트: mast3rpee/blw
 /**
  * Dynamic properties.
  *
  * @param string $name
  *            Label of property to set.
  * @param mixed $value
  *            Value of property.
  */
 public function __set($name, $value)
 {
     // Try to set property
     switch ($name) {
         // IRequest
         case 'RequestURI':
             $result = $this->setRequestURI($value);
             break;
         case 'URI':
             $result = $this->setURI($value);
             break;
         case 'Protocol':
         case 'Version':
         case 'Status':
         case 'Header':
         case 'Body':
             $result = IDataMapper::READONLY;
             break;
             // Undefined property
         // Undefined property
         default:
             $result = IDataMapper::UNDEFINED;
     }
     // Check results
     if (list($Message, $Level) = ADataMapper::getErrorInfo($result, get_class($this), $name)) {
         trigger_error($Message, $Level);
     }
 }
예제 #4
0
파일: APage.php 프로젝트: mast3rpee/blw
 /**
  * Dynamic properties.
  *
  * @param string $name
  *            Label of property to set.
  * @param mixed $value
  *            Value of property.
  */
 public function __set($name, $value)
 {
     switch ($name) {
         // ISerializable
         case 'Status':
         case 'Serializer':
             // IIterable
         // IIterable
         case 'ID':
             $result = IDataMapper::READONLY;
             break;
         case 'Parent':
             $result = $this->setParent($value);
             break;
             // IMediatable
         // IMediatable
         case 'Mediator':
             $result = $this->setMediator($value);
             break;
         case 'MediatorID':
             // IComponentMapable
         // IComponentMapable
         case 'Component':
             // Page
         // Page
         case 'RequestHead':
         case 'ResponseHead':
         case 'Base':
             $result = IDataMapper::READONLY;
             break;
         case 'Created':
             $result = $this->setCreated($value);
             break;
         case 'Modified':
             $result = $this->setModified($value);
             break;
         case 'Document':
         case 'File':
             $result = IDataMapper::READONLY;
             break;
         default:
             // Try to set component property
             try {
                 $this->_Component->{$name} = $value;
                 $result = IDataMapper::UPDATED;
             } catch (\Exception $e) {
                 $result = IDataMapper::UNDEFINED;
             }
             // @codeCoverageIgnoreEnd
     }
     // Check results
     if (list($Message, $Level) = ADataMapper::getErrorInfo($result, get_class($this), $name)) {
         trigger_error($Message, $Level);
     }
 }
예제 #5
0
 /**
  * @depends test_setField
  * @covers ::__loadFields
  */
 public function test_loadFields()
 {
     $Valid = array(array('foo', ADataMapper::createRead($foo), ADataMapper::createWrite($foo)), array('bar', ADataMapper::createRead($bar), ADataMapper::createWrite($bar)));
     $Invalid = array(array(NULL, ADataMapper::createRead($foo), ADataMapper::createWrite($foo)), array(NULL, ADataMapper::createRead($bar), ADataMapper::createWrite($bar)));
     # Test valid arguments
     $this->assertTrue($this->DataMapper->__loadFields($Valid), 'IDataMapper::__loadFields() should return true.');
     # Test invalid arguments
     try {
         $this->DataMapper->__loadFields($Invalid);
         $this->fail('Failed to generate exception with invalid parameter');
     } catch (InvalidArgumentException $e) {
     }
 }
예제 #6
0
 /**
  * Dynamic properties.
  *
  * @param string $name
  *            Label of property to set.
  * @param mixed $value
  *            Value of property.
  */
 public function __set($name, $value)
 {
     // Try to set property
     switch ($name) {
         // IMediatable
         case 'Mediator':
             $result = $value instanceof IMediator ? $this->setMediator($value) : IDataMapper::INVALID;
             break;
         case 'MediatorID':
             $result = IDataMapper::READONLY;
             break;
             // IAddressHandler
         // IAddressHandler
         case 'To':
             $result = $value instanceof IEmailAddress ? $this->addTo($value) : IDataMapper::INVALID;
             break;
         case 'From':
             $result = $value instanceof IEmailAddress ? $this->addFrom($value) : IDataMapper::INVALID;
             break;
         case 'ReplyTo':
             $result = $value instanceof IEmailAddress ? $this->addReplyTo($value) : IDataMapper::INVALID;
             break;
         case 'CC':
             $result = $value instanceof IEmailAddress ? $this->addCC($value) : IDataMapper::INVALID;
             break;
         case 'BCC':
             $result = $value instanceof IEmailAddress ? $this->addBCC($value) : IDataMapper::INVALID;
             break;
             // IMessage
         // IMessage
         case 'HTML':
             $result = $this->setHTML($value);
             break;
         case 'Text':
             $result = $this->setText($value);
             break;
         case 'Subject':
             $result = $this->setSubject($value);
             break;
             // IObject
         // IObject
         default:
             return parent::__set($name, $value);
     }
     // Check results
     if (list($Message, $Level) = ADataMapper::getErrorInfo($result, get_class($this), $name)) {
         trigger_error($Message, $Level);
     }
 }
예제 #7
0
파일: AElement.php 프로젝트: mast3rpee/blw
 /**
  * Dynamic properties.
  *
  * @param string $name
  *            Label of property to set.
  * @param mixed $value
  *            Value of property.
  */
 public function __set($name, $value)
 {
     // Try to set property
     switch ($name) {
         // IIterable
         case 'ID':
             $result = $this->setID($value);
             break;
         case 'Parent':
             $result = $this->setParent($value);
             break;
             // Element
         // Element
         case 'Document':
             $result = IDataMapper::READONLY;
             break;
         case 'innerHTML':
             $result = $this->setInnerHTML($value) ? IDataMapper::UPDATED : IDataMapper::INVALID;
             break;
         case 'outerHTML':
             $result = $this->setOuterHTML($value) ? IDataMapper::UPDATED : IDataMapper::INVALID;
             break;
             // Undefined property
         // Undefined property
         default:
             $result = IDataMapper::UNDEFINED;
     }
     // Check results
     if (list($Message, $Level) = ADataMapper::getErrorInfo($result, get_class($this), $name)) {
         trigger_error($Message, $Level);
     }
 }
예제 #8
0
파일: AWrapper.php 프로젝트: mast3rpee/blw
 /**
  * Dynamic properties.
  *
  * @param string $name
  *            Label of property to set.
  * @param mixed $value
  *            Value of property.
  */
 public function __set($name, $value)
 {
     switch ($name) {
         // ISerializable
         case 'Status':
         case 'Serializer':
             // IIterable
         // IIterable
         case 'ID':
             $result = IDataMapper::READONLY;
             break;
         case 'Parent':
             $result = $this->setParent($value);
             break;
             // IComponentMapable
         // IComponentMapable
         case 'Component':
             $result = IDataMapper::READONLY;
             break;
         default:
             // Try to set component property
             try {
                 $this->_Component->{$name} = $value;
                 $result = IDataMapper::UPDATED;
             } catch (\Exception $e) {
                 $result = IDataMapper::UNDEFINED;
             }
     }
     // Check results
     if (list($Message, $Level) = ADataMapper::getErrorInfo($result, get_class($this), $name)) {
         trigger_error($Message, $Level);
     }
 }
예제 #9
0
파일: AOption.php 프로젝트: mast3rpee/blw
 /**
  * Dynamic properties.
  *
  * @param string $name
  *            Label of property to set.
  * @param mixed $value
  *            Value of property.
  * @return boolean Returns a <code>IDataMapper</code> status code.
  */
 public function __set($name, $value)
 {
     // Try to set property
     switch ($name) {
         // IOption
         case 'Name':
         case 'Value':
             $result = IDataMapper::READONLY;
             break;
             // Undefined property
         // Undefined property
         default:
             $result = IDataMapper::UNDEFINED;
     }
     // Check results
     if (list($Message, $Level) = ADataMapper::getErrorInfo($result, get_class($this), $name)) {
         trigger_error($Message, $Level);
     }
 }
예제 #10
0
파일: ABrowser.php 프로젝트: mast3rpee/blw
 /**
  * Dynamic properties.
  *
  * @param string $name
  *            Label of property to set.
  * @param mixed $value
  *            Value of property.
  */
 public function __set($name, $value)
 {
     // Try to set property
     switch ($name) {
         // ISerializable
         case 'Status':
         case 'Serializer':
             // IIterable
         // IIterable
         case 'ID':
             $result = IDataMapper::READONLY;
             break;
         case 'Parent':
             $result = $this->setParent($value);
             break;
             // IComponentMapable
         // IComponentMapable
         case 'Component':
             // IBrowser
         // IBrowser
         case 'Client':
         case 'RequestFactory':
         case 'Plugins':
         case 'Engines':
             $result = IDataMapper::READONLY;
             break;
         case 'UserAgent':
             $result = $this->setUserAgent($value);
             break;
             // IWrapper
         // IWrapper
         default:
             // Try to set component property
             try {
                 $this->_Component->{$name} = $value;
                 $result = IDataMapper::UPDATED;
                 // @codeCoverageIgnoreStart
                 // Error
             } catch (\Exception $e) {
                 $result = IDataMapper::UNDEFINED;
             }
             // @codeCoverageIgnoreEnd
     }
     // Check results
     if (list($Message, $Level) = ADataMapper::getErrorInfo($result, get_class($this), $name)) {
         trigger_error($Message, $Level);
     }
 }
예제 #11
0
파일: File.php 프로젝트: mast3rpee/blw
 /**
  * Dynamic properties.
  *
  * @param string $name
  *            Label of property to set.
  * @param mixed $value
  *            Value of property.
  */
 public function __set($name, $value)
 {
     switch ($name) {
         // ISerializable
         case 'Status':
         case 'Serializer':
             // IIterable
         // IIterable
         case 'ID':
             $result = IDataMapper::READONLY;
             break;
         case 'Parent':
             $result = $this->setParent($value);
             break;
             // IStream
         // IStream
         case 'fp':
             // IFileStream
         // IFileStream
         case 'File':
         case 'Flags':
         case 'Options':
             $result = IDataMapper::READONLY;
             break;
         default:
             $result = IDataMapper::UNDEFINED;
             break;
     }
     // Check results
     if (list($Message, $Level) = ADataMapper::getErrorInfo($result, get_class($this), $name)) {
         trigger_error($Message, $Level);
     }
 }