/** * Clears the current object, sets all attributes to their default values and removes * outgoing references as well as back-references (from other objects to this one. Results probably in a database * change of those foreign objects when you call `save` there). */ public function clear() { if (null !== $this->aPeriod) { $this->aPeriod->removeApplication($this); } if (null !== $this->aSubject) { $this->aSubject->removeApplication($this); } if (null !== $this->aStudent) { $this->aStudent->removeApplication($this); } if (null !== $this->aSchoolYear) { $this->aSchoolYear->removeApplication($this); } $this->id = null; $this->student_id = null; $this->subject_id = null; $this->period_id = null; $this->school_year_id = null; $this->application_date = null; $this->exam_date = null; $this->exam_time = null; $this->exam_score = null; $this->created_at = null; $this->updated_at = null; $this->alreadyInSave = false; $this->clearAllReferences(); $this->applyDefaultValues(); $this->resetModified(); $this->setNew(true); $this->setDeleted(false); }
/** * Filter the query by a related \App\Models\Period object * * @param \App\Models\Period|ObjectCollection $period The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @throws \Propel\Runtime\Exception\PropelException * * @return ChildApplicationQuery The current query, for fluid interface */ public function filterByPeriod($period, $comparison = null) { if ($period instanceof \App\Models\Period) { return $this->addUsingAlias(ApplicationTableMap::COL_PERIOD_ID, $period->getId(), $comparison); } elseif ($period instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(ApplicationTableMap::COL_PERIOD_ID, $period->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByPeriod() only accepts arguments of type \\App\\Models\\Period or Collection'); } }
/** * Clears the current object, sets all attributes to their default values and removes * outgoing references as well as back-references (from other objects to this one. Results probably in a database * change of those foreign objects when you call `save` there). */ public function clear() { if (null !== $this->aPeriod) { $this->aPeriod->removePeriodSchoolYear($this); } if (null !== $this->aSchoolYear) { $this->aSchoolYear->removePeriodSchoolYear($this); } $this->period_id = null; $this->school_year_id = null; $this->date_start = null; $this->date_end = null; $this->created_at = null; $this->updated_at = null; $this->alreadyInSave = false; $this->clearAllReferences(); $this->resetModified(); $this->setNew(true); $this->setDeleted(false); }
/** * Exclude object from result * * @param ChildPeriod $period Object to remove from the list of results * * @return $this|ChildPeriodQuery The current query, for fluid interface */ public function prune($period = null) { if ($period) { $this->addUsingAlias(PeriodTableMap::COL_ID, $period->getId(), Criteria::NOT_EQUAL); } return $this; }
public static function GenerateFake($faker) { return ['end_period' => $faker->dateTime($min = 'now')->format('Y-m-d h:m:s'), 'period_id' => $faker->numberBetween($min = 1, $max = Period::count())]; }
public function typeMustBeUnique(FunctionalTester $I) { $this->model->type = Period::findFirst()->type; $I->assertFalse($this->model->save()); }