Closed f3l1x closed 9 years ago
Ok, I was thinking and this is probably wont fix. Getters are not supported for IPropertyContainers. If you need getter eg. for placeholder, use new virtual property.
/**
* @property Image|NULL $image {1:1d ImagesRepository primary}
* @property-read Image $imageAlways {virtual}
*/
class Book extends Entity
{
protected function getterImageAlaways()
{
return $this->image ?: new Image('placeholder');
}
}
We should probably add doc for this and also throw exception when you defined getter|setter for IPropertyContianer.
Yes. It's oukey. I have already do that.
Thanks for adding to doc.
In referenced column does not work getter*. In my case if image is NULL.
I guess cause of that - https://github.com/nextras/orm/blob/master/src/Entity/AbstractEntity.php#L420-L422