classes/database/orm.php
/**
	 * Removes a relationship between this model and another.
	 *
	 * @param string $alias of the has_many "through" relationship
	 * @param object $model the related ORM model
	 * @return boolean
	 */
Removes a relationship between this model and another.
@param string $alias of the has_many "through" relationship
@param object $model the related ORM model
@return boolean
Removes a relationship between this model and another . @param string $alias of the has_many " through " relationship @param object $model the related ORM model @return boolean
public function remove($alias, $model)
	{
		if(empty(self::$_aliases[$this->name()]['has_many'][$alias]))
		{
			throw new Exception($alias. ' alias is not found.');
		}
		$alias = self::$_aliases[$this->name()]['has_many'][$alias];
		$sql = 'DELETE FROM "'. $alias['through']. '" WHERE "'
		. $model->name().$this->_foreign_key_suffix. '" = ? AND "'
		. $this->name().$this->_foreign_key_suffix. '" = ?';
		return $this->_db->count($sql, array($model->pk(), $this->pk()));
	}
public function remove ( $ alias , $ model ) { if ( empty ( self :: $ _aliases [ $ this -> name ( ) ] [ 'has_many' ] [ $ alias ] ) ) { throw new Exception ( $ alias . ' alias is not found.' ) ; } $ alias = self :: $ _aliases [ $ this -> name ( ) ] [ 'has_many' ] [ $ alias ] ; $ sql = 'DELETE FROM "' . $ alias [ 'through' ] . '" WHERE "' . $ model -> name ( ) . $ this -> _foreign_key_suffix . '" = ? AND "' . $ this -> name ( ) . $ this -> _foreign_key_suffix . '" = ?' ; return $ this -> _db -> count ( $ sql , array ( $ model -> pk ( ) , $ this -> pk ( ) ) ) ; }
Removes a relationship between this model and another.
Removes a relationship between this model and another .