コード例 #1
0
ファイル: Entity.php プロジェクト: aeberh/php-movico
 public function addOneManyProperty(OneToManyProperty $property)
 {
     $property->setEntity($this);
     $this->oneToManyProperties[] = $property;
 }
コード例 #2
0
 private function generateOneToManyFinder(OneToManyProperty $property)
 {
     $columnName = $property->getMappingKey();
     return "\tpublic function {$property->getFinderSignature()} {\n" . "\t\t\$limitStr = (\$from == -1 && \$limit == -1) ? \"\" : \" LIMIT \$from,\$limit\";\n" . "\t\t\$rows = \$this->db->selectQuery(\"SELECT * FROM \".self::TABLE.\" WHERE {$columnName}='\${$columnName}' {$property->getEntity()->getOrderByClause()}\$limitStr\")->getResult();\n" . "\t\treturn \$this->getAsObjects(\$rows);\n\t}\n\n";
 }