Esempio n. 1
0
	/**
	 * Exclude object from result
	 *
	 * @param     PlugIn $plugIn Object to remove from the list of results
	 *
	 * @return    PlugInQuery The current query, for fluid interface
	 */
	public function prune($plugIn = null)
	{
		if ($plugIn) {
			$this->addUsingAlias(PlugInPeer::ID, $plugIn->getId(), Criteria::NOT_EQUAL);
		}

		return $this;
	}
Esempio n. 2
0
  /**
   * Méthode qui désinstalle proprement le plugin
   *
   * @param object PlugIn $_plugin
   */
  public static function deletePluginComplet(PlugIn $_plugin){
    $_id = $_plugin->getId();
    # On détruit les droits
    $c = new Criteria();
    $c->add(PlugInAutorisationPeer::PLUGIN_ID, $_id, Criteria::EQUAL);
    $autorisation = PlugInAutorisationPeer::doDelete($c);
    # On détruit les menus
    $c = new Criteria();
    $c->add(PlugInMiseEnOeuvreMenuPeer::PLUGIN_ID, $_id, Criteria::EQUAL);
    $autorisation = PlugInMiseEnOeuvreMenuPeer::doDelete($c);
    # On détruit le plugin
    $plugin = PlugInPeer::doDelete($_id);

    return true;
  }
Esempio n. 3
0
	/**
	 * Declares an association between this object and a PlugIn object.
	 *
	 * @param      PlugIn $v
	 * @return     PlugInAutorisation The current object (for fluent API support)
	 * @throws     PropelException
	 */
	public function setPlugIn(PlugIn $v = null)
	{
		if ($v === null) {
			$this->setPluginId(NULL);
		} else {
			$this->setPluginId($v->getId());
		}

		$this->aPlugIn = $v;

		// Add binding for other direction of this n:n relationship.
		// If this object has already been added to the PlugIn object, it will not be re-added.
		if ($v !== null) {
			$v->addPlugInAutorisation($this);
		}

		return $this;
	}
	/**
	 * Filter the query by a related PlugIn object
	 *
	 * @param     PlugIn|PropelCollection $plugIn The related object(s) to use as filter
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    PlugInAutorisationQuery The current query, for fluid interface
	 */
	public function filterByPlugIn($plugIn, $comparison = null)
	{
		if ($plugIn instanceof PlugIn) {
			return $this
				->addUsingAlias(PlugInAutorisationPeer::PLUGIN_ID, $plugIn->getId(), $comparison);
		} elseif ($plugIn instanceof PropelCollection) {
			if (null === $comparison) {
				$comparison = Criteria::IN;
			}
			return $this
				->addUsingAlias(PlugInAutorisationPeer::PLUGIN_ID, $plugIn->toKeyValue('PrimaryKey', 'Id'), $comparison);
		} else {
			throw new PropelException('filterByPlugIn() only accepts arguments of type PlugIn or PropelCollection');
		}
	}