Bug #47637
Property with @ORM\Column(nullable=true,type="decimal",scale=2) results as type "string" in Collection Objects and not as expected as "double"
Status: | New | Start date: | 2013-04-27 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | - | % Done: | 0% |
|
Category: | - | |||
Target version: | - | |||
Affected Flow version: | Git master |
Description
having a value object:
/**
* A Price Value
*
* @Flow\ValueObject
*/
class Price{
/**
* @var float
* @FLOW\Validate(type="NotEmpty")
* @ORM\Column(nullable=true,type="decimal",scale=2)
*/
protected $value;
/**
* @param float $value
*/
public function __construct($value) {
$this->value = $value;
}
/**
* @return float
*/
public function getValue() {
return $this->value;
}
}
anything works fine until this:
in a doctrine collection wich contains prices, the type of property $value is "string" and not of type "double".
so the following fails: if($this->prices->contains($newPriceWithSameValue)) because property $value of "newPriceWithSameValue" is type of "double".