/** * Store a newly created resource in storage. * * @return Response */ public function store(PeriodRequest $request) { $data = $request->all(); $period = new PeriodSchoolYear(); $period->fromArray($data); $period->save(); flash()->success("ADDED"); session(['attribute' => \Lang::get('general.PERIOD')]); return redirect($this->main_page); }
/** * Exclude object from result * * @param ChildPeriodSchoolYear $periodSchoolYear Object to remove from the list of results * * @return $this|ChildPeriodSchoolYearQuery The current query, for fluid interface */ public function prune($periodSchoolYear = null) { if ($periodSchoolYear) { $this->addCond('pruneCond0', $this->getAliasedColName(PeriodSchoolYearTableMap::COL_PERIOD_ID), $periodSchoolYear->getPeriodId(), Criteria::NOT_EQUAL); $this->addCond('pruneCond1', $this->getAliasedColName(PeriodSchoolYearTableMap::COL_SCHOOL_YEAR_ID), $periodSchoolYear->getSchoolYearId(), Criteria::NOT_EQUAL); $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR); } return $this; }
/** * Filter the query by a related \App\Models\PeriodSchoolYear object * * @param \App\Models\PeriodSchoolYear|ObjectCollection $periodSchoolYear the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildSchoolYearQuery The current query, for fluid interface */ public function filterByPeriodSchoolYear($periodSchoolYear, $comparison = null) { if ($periodSchoolYear instanceof \App\Models\PeriodSchoolYear) { return $this->addUsingAlias(SchoolYearTableMap::COL_ID, $periodSchoolYear->getSchoolYearId(), $comparison); } elseif ($periodSchoolYear instanceof ObjectCollection) { return $this->usePeriodSchoolYearQuery()->filterByPrimaryKeys($periodSchoolYear->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByPeriodSchoolYear() only accepts arguments of type \\App\\Models\\PeriodSchoolYear or Collection'); } }
/** * @param ChildPeriodSchoolYear $periodSchoolYear The ChildPeriodSchoolYear object to add. */ protected function doAddPeriodSchoolYear(ChildPeriodSchoolYear $periodSchoolYear) { $this->collPeriodSchoolYears[] = $periodSchoolYear; $periodSchoolYear->setPeriod($this); }
/** * Adds an object to the instance pool. * * Propel keeps cached copies of objects in an instance pool when they are retrieved * from the database. In some cases you may need to explicitly add objects * to the cache in order to ensure that the same objects are always returned by find*() * and findPk*() calls. * * @param \App\Models\PeriodSchoolYear $obj A \App\Models\PeriodSchoolYear object. * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). */ public static function addInstanceToPool($obj, $key = null) { if (Propel::isInstancePoolingEnabled()) { if (null === $key) { $key = serialize(array((string) $obj->getPeriodId(), (string) $obj->getSchoolYearId())); } // if key === null self::$instances[$key] = $obj; } }