/** * Inserts a job into a given package * * @param mixed $package */ public function insertIntoPackage($package) { $job = new JobModel($this->em); $job->setPackage($package); $this->em->persist($job); return $job; }
/** * Creates a new job and adds it to the specified package. * * @param integer $packageID * @param array $data * @param array $files * @return bool|JobModel */ public function createJob($packageID, $data, $files) { $package = $this->getPackageMapper()->findPackage($packageID); $job = new JobModel(); $job->setPackage($package); return $this->saveJobData($job, $data, $files); }