Пример #1
0
 public function setOptions(array $options)
 {
     if (!isset($options['identity'])) {
         $options['identity'] = array();
     }
     $this->setIdentity($options['identity']);
     unset($options['identity']);
     Waf_Model_Configurator::setOptions($this, $options);
 }
Пример #2
0
 /**
  * Constructor requires the property name as defined in the Entity.
  *
  * - If $options is an array, the property gets configured using
  *   Waf_Model_Configurator
  * - If $options is a string, it is treated as it would be the property name
  *   as defined in the Storage
  *
  * @param string $propertyName
  * @param array|string $options
  */
 public function __construct($options = array())
 {
     if (is_string($options)) {
         $options = array('propertyName' => $options);
     }
     if (!isset($options['propertyName'])) {
         throw new Waf_Model_Mapper_Exception('PropertyName is required for configuring a Property');
     }
     Waf_Model_Configurator::setOptions($this, $options);
 }
Пример #3
0
 public function testSetArray()
 {
     $options = array('foo' => array('bar', 'baz'));
     Waf_Model_Configurator::setOptions($this->testObject, $options);
     $this->assertType('array', $this->testObject->getFoo());
 }