/** * Exclude object from result * * @param ChildFile $file Object to remove from the list of results * * @return $this|ChildFileQuery The current query, for fluid interface */ public function prune($file = null) { if ($file) { $this->addUsingAlias(FileTableMap::COL_ID, $file->getId(), Criteria::NOT_EQUAL); } return $this; }
protected function fileValidateOne() { setContentType("json"); $file = new File(); $given = array_keys($_POST); $response["error"] = null; if (count($given) == 1) { if ($given[0] == "description") { $file->setDescription($_POST["description"]); } if (!$file->validate()) { foreach ($file->getValidationFailures() as $failure) { if ($given[0] == $failure->getPropertyPath()) { $response["error"] = array("name" => $failure->getPropertyPath(), "message" => $failure->getMessage()); } } } $this->viewString(json_encode($response)); } }
/** * @param ChildFile $file The ChildFile object to add. */ protected function doAddFile(ChildFile $file) { $this->collFiles[] = $file; $file->setNote($this); }
/** * Filter the query by a related \Models\File object * * @param \Models\File|ObjectCollection $file the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildPackQuery The current query, for fluid interface */ public function filterByFile($file, $comparison = null) { if ($file instanceof \Models\File) { return $this->addUsingAlias(PackTableMap::COL_ID, $file->getPackId(), $comparison); } elseif ($file instanceof ObjectCollection) { return $this->useFileQuery()->filterByPrimaryKeys($file->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByFile() only accepts arguments of type \\Models\\File or Collection'); } }