/** * Add Package entity to collection (one to many). * * @param \Entity\Package $package * @return \Entity\Order */ public function addPackage(Package $package) { if (!is_numeric($package->getSessionId())) { #$id = \count($this->getPackages())+1; #$package->setSessionId($id); $package->setSessionId($this->getSessionId('package')); } $this->packages[] = $package; return $this; }