Oznámení
vlastny datovy typ v properties
- stajo
- Člen | 8
zdravim,
nieco som nasiel tu:
https://forum.dibiphp.com/…orm-nad-dibi?p=15
ale moc mi to nepomohlo
mam entiu:
/**
- @property MatchResult $matchResult m:passThru(convertToPoint|)
*/
class Match extends \LeanMapper\Entity {
public function convertToPoint($value) {
return (string) $value;
}
}
kde MatchResult obsahuje metodu:
public function __toString() {
return sprintf(„POINT(%s, %s)“, $this->player1Score,
$this->player2Score);
}
pri citani z property:
$match->matchResult
mam chybu:
LeanMapper\Exception\InvalidValueException: Property ‚matchResult‘ in entity
GameModule\Model\Entity\Match is expected to contain an instance of
GameModule\Model\Entity\MatchResult, string given.
potrbujem to, aby som mohol ukladat data do typu POINT, takze by mi pomohlo
aj ine riesenie.
dik