setTable('focus_stats') ->setCustomRepositoryClass(StatRepository::class) ->addIndex(['type'], 'focus_type') ->addIndex(['type', 'type_id'], 'focus_type_id') ->addIndex(['date_added'], 'focus_date_added'); $builder->addId(); $builder->createManyToOne('focus', 'Focus') ->addJoinColumn('focus_id', 'id', false, false, 'CASCADE') ->build(); $builder->addField('type', 'string'); $builder->addNamedField('typeId', 'integer', 'type_id', true); $builder->addNamedField('dateAdded', 'datetime', 'date_added'); $builder->addLead(true, 'SET NULL'); } /** * @return mixed */ public function getId() { return $this->id; } /** * @return mixed */ public function getFocus() { return $this->focus; } /** * @param mixed $focus * * @return Stat */ public function setFocus($focus) { $this->focus = $focus; return $this; } /** * @return mixed */ public function getType() { return $this->type; } /** * @param mixed $type * * @return Stat */ public function setType($type) { $this->type = $type; return $this; } /** * @return mixed */ public function getTypeId() { return $this->typeId; } /** * @param mixed $typeId * * @return Stat */ public function setTypeId($typeId) { $this->typeId = $typeId; return $this; } /** * @return mixed */ public function getDateAdded() { return $this->dateAdded; } /** * @param mixed $dateAdded * * @return Stat */ public function setDateAdded($dateAdded) { $this->dateAdded = $dateAdded; return $this; } /** * @return ?Lead */ public function getLead() { return $this->lead; } /** * @return Stat */ public function setLead(Lead $lead) { $this->lead = $lead; return $this; } }