private function createGetter($tableMap, $column)
 {
     if ($tableMap->containsColumn($column)) {
         $col = $tableMap->getColumn($column);
         if ($col->getRelatedTableName()) {
             $methodName = afMetaDb::getRelatedMethodName($col);
             $getter = $this->createMethodGetter($methodName);
         } else {
             $methodName = 'get' . $col->getPhpName();
             if ($col->isTemporal()) {
                 $getter = new afDatetimeGetter($methodName);
             } else {
                 $getter = $this->createMethodGetter($methodName);
             }
         }
     } else {
         $methodName = 'get' . sfInflector::camelize($column);
         $getter = $this->createMethodGetter($methodName, in_array($column, $this->specialColumns));
     }
     return $getter;
 }
Exemplo n.º 2
0
<?php

include dirname(__FILE__) . '/../bootstrap/dbunit.php';
$t = new lime_test(2, new lime_output_color());
$colMap = EventInfoPeer::getTableMap()->getColumn('publisher_id');
$t->is(afMetaDb::getRelatedMethodName($colMap), 'getPublisher');
$colMap = EventInfoPeer::getTableMap()->getColumn('confidentiality_id');
$t->is(afMetaDb::getRelatedMethodName($colMap), 'getEventImpactRelatedByConfidentialityId');