use pq\Mapper\RefProperty;
use pq\Mapper\RefPropertyInterface;
use UnexpectedValueException;
use pq\Mapper\RefProperty;
use pq\Mapper\RefPropertyInterface;
use UnexpectedValueException;
function __construct(Mapper $mapper, $property) {
$this->mapper = $mapper;
$this->property = $property;
}
function __construct(Mapper $mapper, $property) {
$this->mapper = $mapper;
$this->property = $property;
}
function read(Row $row, $objectToUpdate) {
$val = $this->extract($objectToUpdate);
if (!isset($val)) {
function read(Row $row, $objectToUpdate) {
$val = $this->extract($objectToUpdate);
if (!isset($val)) {
if (!$rel = $map->relOf($this->container, $this->refName)) {
throw new UnexpectedValueException(
sprintf("Unrelated reference from %s to %s with name %s",
if (!$rel = $map->relOf($this->container, $this->refName)) {
throw new UnexpectedValueException(
sprintf("Unrelated reference from %s to %s with name %s",
private function findFieldProperty($col) {
$map = $this->mapper->mapOf($this->refClass);
return array_filter($map->getProperties(), function($property) use($col) {
private function findFieldProperty($col) {
$map = $this->mapper->mapOf($this->refClass);
return array_filter($map->getProperties(), function($property) use($col) {