/** * * @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); }
/** * * @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); }
/** * Returns this attributes value * * @return float */ public function getValue() { return (double) parent::getValue(); }
/** * Returns this attributes value * * @return integer */ public function getValue() { return (int) parent::getValue(); }
/** * 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; }
/** * Returns this attributes value * * @return integer */ public function getValue() { return (string) parent::getValue(); }
/** * 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); } }
/** * 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); }
public function testValue() { $property = new Morph_Property_Generic('TestProperty', 'TestValue'); $property->setValue('AValue'); $this->assertEquals('AValue', $property->getValue()); }
/** * * @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); }