/** * Exclude object from result * * @param CcMusicDirs $ccMusicDirs Object to remove from the list of results * * @return CcMusicDirsQuery The current query, for fluid interface */ public function prune($ccMusicDirs = null) { if ($ccMusicDirs) { $this->addUsingAlias(CcMusicDirsPeer::ID, $ccMusicDirs->getId(), Criteria::NOT_EQUAL); } return $this; }
/** * Declares an association between this object and a CcMusicDirs object. * * @param CcMusicDirs $v * @return CcFiles The current object (for fluent API support) * @throws PropelException */ public function setCcMusicDirs(CcMusicDirs $v = null) { if ($v === null) { $this->setDbDirectory(NULL); } else { $this->setDbDirectory($v->getId()); } $this->aCcMusicDirs = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the CcMusicDirs object, it will not be re-added. if ($v !== null) { $v->addCcFiles($this); } return $this; }
/** * Filter the query by a related CcMusicDirs object * * @param CcMusicDirs $ccMusicDirs the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return CcFilesQuery The current query, for fluid interface */ public function filterByCcMusicDirs($ccMusicDirs, $comparison = null) { return $this->addUsingAlias(CcFilesPeer::DIRECTORY, $ccMusicDirs->getId(), $comparison); }
/** * 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 -- especially when you override doSelect*() * methods in your stub classes -- you may need to explicitly add objects * to the cache in order to ensure that the same objects are always returned by doSelect*() * and retrieveByPK*() calls. * * @param CcMusicDirs $value A CcMusicDirs object. * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). */ public static function addInstanceToPool(CcMusicDirs $obj, $key = null) { if (Propel::isInstancePoolingEnabled()) { if ($key === null) { $key = (string) $obj->getId(); } // if key === null self::$instances[$key] = $obj; } }
public static function addDir($p_path, $p_type) { if (!is_dir($p_path)) { return array("code" => 2, "error" => "'{$p_path}' is not a valid directory."); } $dir = new CcMusicDirs(); $dir->setType($p_type); $p_path = realpath($p_path) . "/"; try { /* isPathValid() checks if path is a substring or a superstring of an * existing dir and if not, throws NestedDirectoryException */ self::isPathValid($p_path); $dir->setDirectory($p_path); $dir->save(); return array("code" => 0); } catch (NestedDirectoryException $nde) { $msg = $nde->getMessage(); return array("code" => 1, "error" => "{$msg}"); } catch (Exception $e) { return array("code" => 1, "error" => "'{$p_path}' is already set as the current storage dir or in the watched folders list"); } }