/** * Gets the right tableMap for this join * * @return TableMap The table map */ public function getTableMap() { if (null === $this->tableMap && null !== $this->relationMap) { $this->tableMap = $this->relationMap->getRightTable(); } return $this->tableMap; }
/** * Create array of options for relation. * * @param \RelationMap $relation * @return array */ public function getChoicesFromRelation(\RelationMap $relation) { $otherTable = $relation->getRightTable(); $objs = \PropelQuery::from($otherTable->getPhpName())->setFormatter(\ModelCriteria::FORMAT_ON_DEMAND)->find(); $opts = array(); foreach ($objs as $obj) { if (method_exists($obj, '__toString')) { $opts[$obj->getPrimaryKey()] = $obj->__toString(); } else { $opts[$obj->getPrimaryKey()] = $obj->getPrimaryKey(); } } return $opts; }