Esempio n. 1
0
 /**
  *
  * @param String $name
  * @param String $type
  * @return Morph_Property_HasMany
  */
 public function __construct($name, $type)
 {
     $this->Type = $type;
     $this->Value = new Morph_Collection();
     $this->Value->setPermissableType($type);
     parent::__construct($name);
 }
Esempio n. 2
0
 /**
  *
  * @param string $name
  * @param string $type the classname this property should hold
  * @param $default
  * @return Morph_Property_hasOne
  */
 public function __construct($name)
 {
     parent::__construct($name, null);
 }
Esempio n. 3
0
 /**
  * Returns this attributes value
  *
  * @return float
  */
 public function getValue()
 {
     return (double) parent::getValue();
 }
Esempio n. 4
0
 /**
  * Returns this attributes value
  *
  * @return integer
  */
 public function getValue()
 {
     return (int) parent::getValue();
 }
Esempio n. 5
0
 /**
  * Adds a new property to this object
  *
  * @param Morph_Property_Generic $property
  * @return Morph_Object
  */
 protected function addProperty(Morph_Property_Generic $property)
 {
     $this->propertySet[$property->getName()] = $property;
     return $this;
 }
Esempio n. 6
0
 /**
  * Returns this attributes value
  *
  * @return integer
  */
 public function getValue()
 {
     return (string) parent::getValue();
 }
Esempio n. 7
0
 /**
  * Overrides parent setValue to add enum value checking
  *
  * @see classes/ar/ar_Field#setValue()
  */
 public function setValue($value)
 {
     if ($this->isValidEnum($value)) {
         parent::setValue($value);
     }
 }
Esempio n. 8
0
 /**
  * Creates a property to contain a reference to another Morph_Object
  *
  * @param string $name The name to associate with this property
  * @param string $type The class that this property should contain
  * @return Morph_Object
  */
 public function __construct($name, $type)
 {
     $this->Type = $type;
     parent::__construct($name);
 }
Esempio n. 9
0
 public function testValue()
 {
     $property = new Morph_Property_Generic('TestProperty', 'TestValue');
     $property->setValue('AValue');
     $this->assertEquals('AValue', $property->getValue());
 }
Esempio n. 10
0
 /**
  *
  * @param string $name
  * @param string $type the classname this property should hold
  * @param $default
  * @return Morph_Property_hasOne
  */
 public function __construct($name, $type, Morph_Object $default = null)
 {
     $this->Type = $type;
     $this->isPermissableType($default);
     parent::__construct($name, $default);
 }