23 $this->manyToOne=
false;
29 $annotationsStr=
"\n\t/**";
35 $annotationsStr.=
"\n\t * " . implode(
"\n\t * ",
$annotations);
39 $annotationsStr.=
"\n\t*/";
41 return $annotationsStr .
"\n\tprivate $" . $this->name .
";\n";
45 if ($this->primary ===
false) {
54 $annot->dbType=$infos[
"Type"];
55 $annot->nullable=(\strtolower($infos[
"Nullable"])===
"yes");
62 $joinColumn->name=
$name;
63 $joinColumn->className=$className;
64 $joinColumn->nullable=$nullable;
66 $this->manyToOne=
true;
71 $oneToMany->mappedBy=$mappedBy;
72 $oneToMany->className=$className;
76 public function addManyToMany($targetEntity, $inversedBy, $joinTable, $joinColumns=[], $inverseJoinColumns=[]) {
78 $manyToMany->targetEntity=$targetEntity;
79 $manyToMany->inversedBy=$inversedBy;
82 if (\
sizeof($joinColumns) == 2) {
83 $jt->joinColumns=$joinColumns;
85 if (\
sizeof($inverseJoinColumns) == 2) {
86 $jt->inverseJoinColumns=$inverseJoinColumns;
114 $result=
"\n\t public function get" . \ucfirst($this->name) .
"(){\n";
115 $result.=
"\t\t" .
'return $this->' . $this->name .
";\n";
121 $result=
"\n\t public function set" . \ucfirst($this->name) .
'($' . $this->name .
"){\n";
122 $result.=
"\t\t" .
'$this->' . $this->name .
'=$' . $this->name .
";\n";
addManyToMany($targetEntity, $inversedBy, $joinTable, $joinColumns=[], $inverseJoinColumns=[])
addOneToMany($mappedBy, $className)
addManyToOne($name, $className, $nullable=false)