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"

Added by Carsten Bleicker over 6 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2013-04-27
Due date:
% Done:

0%


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".

Also available in: Atom PDF