<?php

/**
 * Base class that represents a row from the 'node_i18n' table.
 *
 * 
 *
 * @package    plugins.catalyz.lib.model.om
 */
abstract class BaseNodeI18n extends BaseObject  implements Persistent {


	/**
	 * The Peer class.
	 * Instance provides a convenient way of calling static methods on a class
	 * that calling code may not be able to identify.
	 * @var        NodeI18nPeer
	 */
	protected static $peer;


	/**
	 * The value for the id field.
	 * @var        int
	 */
	protected $id;


	/**
	 * The value for the culture field.
	 * @var        string
	 */
	protected $culture;


	/**
	 * The value for the url_type field.
	 * @var        int
	 */
	protected $url_type;


	/**
	 * The value for the url_identifier field.
	 * @var        string
	 */
	protected $url_identifier;


	/**
	 * The value for the title field.
	 * @var        string
	 */
	protected $title;


	/**
	 * The value for the sub_title field.
	 * @var        string
	 */
	protected $sub_title;


	/**
	 * The value for the browser_title_type field.
	 * @var        int
	 */
	protected $browser_title_type;


	/**
	 * The value for the browser_title_content field.
	 * @var        string
	 */
	protected $browser_title_content;


	/**
	 * The value for the seo_keywords_type field.
	 * @var        int
	 */
	protected $seo_keywords_type;


	/**
	 * The value for the seo_keywords_content field.
	 * @var        string
	 */
	protected $seo_keywords_content;


	/**
	 * The value for the seo_description_type field.
	 * @var        int
	 */
	protected $seo_description_type;


	/**
	 * The value for the seo_description_content field.
	 * @var        string
	 */
	protected $seo_description_content;


	/**
	 * The value for the menu_title_type field.
	 * @var        int
	 */
	protected $menu_title_type;


	/**
	 * The value for the menu_title_content field.
	 * @var        string
	 */
	protected $menu_title_content;

	/**
	 * @var        Node
	 */
	protected $aNode;

	/**
	 * Flag to prevent endless save loop, if this object is referenced
	 * by another object which falls in this transaction.
	 * @var        boolean
	 */
	protected $alreadyInSave = false;

	/**
	 * Flag to prevent endless validation loop, if this object is referenced
	 * by another object which falls in this transaction.
	 * @var        boolean
	 */
	protected $alreadyInValidation = false;

	/**
	 * Get the [id] column value.
	 * 
	 * @return     int
	 */
	public function getId()
	{

		return $this->id;
	}

	/**
	 * Get the [culture] column value.
	 * 
	 * @return     string
	 */
	public function getCulture()
	{

		return $this->culture;
	}

	/**
	 * Get the [url_type] column value.
	 * 
	 * @return     int
	 */
	public function getUrlType()
	{

		return $this->url_type;
	}

	/**
	 * Get the [url_identifier] column value.
	 * 
	 * @return     string
	 */
	public function getUrlIdentifier()
	{

		return $this->url_identifier;
	}

	/**
	 * Get the [title] column value.
	 * 
	 * @return     string
	 */
	public function getTitle()
	{

		return $this->title;
	}

	/**
	 * Get the [sub_title] column value.
	 * 
	 * @return     string
	 */
	public function getSubTitle()
	{

		return $this->sub_title;
	}

	/**
	 * Get the [browser_title_type] column value.
	 * 
	 * @return     int
	 */
	public function getBrowserTitleType()
	{

		return $this->browser_title_type;
	}

	/**
	 * Get the [browser_title_content] column value.
	 * 
	 * @return     string
	 */
	public function getBrowserTitleContent()
	{

		return $this->browser_title_content;
	}

	/**
	 * Get the [seo_keywords_type] column value.
	 * 
	 * @return     int
	 */
	public function getSeoKeywordsType()
	{

		return $this->seo_keywords_type;
	}

	/**
	 * Get the [seo_keywords_content] column value.
	 * 
	 * @return     string
	 */
	public function getSeoKeywordsContent()
	{

		return $this->seo_keywords_content;
	}

	/**
	 * Get the [seo_description_type] column value.
	 * 
	 * @return     int
	 */
	public function getSeoDescriptionType()
	{

		return $this->seo_description_type;
	}

	/**
	 * Get the [seo_description_content] column value.
	 * 
	 * @return     string
	 */
	public function getSeoDescriptionContent()
	{

		return $this->seo_description_content;
	}

	/**
	 * Get the [menu_title_type] column value.
	 * 
	 * @return     int
	 */
	public function getMenuTitleType()
	{

		return $this->menu_title_type;
	}

	/**
	 * Get the [menu_title_content] column value.
	 * 
	 * @return     string
	 */
	public function getMenuTitleContent()
	{

		return $this->menu_title_content;
	}

	/**
	 * Set the value of [id] column.
	 * 
	 * @param      int $v new value
	 * @return     void
	 */
	public function setId($v)
	{

		// Since the native PHP type for this column is integer,
		// we will cast the input value to an int (if it is not).
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->id !== $v) {
			$this->id = $v;
			$this->modifiedColumns[] = NodeI18nPeer::ID;
		}

		if ($this->aNode !== null && $this->aNode->getId() !== $v) {
			$this->aNode = null;
		}

	} // setId()

	/**
	 * Set the value of [culture] column.
	 * 
	 * @param      string $v new value
	 * @return     void
	 */
	public function setCulture($v)
	{

		// Since the native PHP type for this column is string,
		// we will cast the input to a string (if it is not).
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->culture !== $v) {
			$this->culture = $v;
			$this->modifiedColumns[] = NodeI18nPeer::CULTURE;
		}

	} // setCulture()

	/**
	 * Set the value of [url_type] column.
	 * 
	 * @param      int $v new value
	 * @return     void
	 */
	public function setUrlType($v)
	{

		// Since the native PHP type for this column is integer,
		// we will cast the input value to an int (if it is not).
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->url_type !== $v) {
			$this->url_type = $v;
			$this->modifiedColumns[] = NodeI18nPeer::URL_TYPE;
		}

	} // setUrlType()

	/**
	 * Set the value of [url_identifier] column.
	 * 
	 * @param      string $v new value
	 * @return     void
	 */
	public function setUrlIdentifier($v)
	{

		// Since the native PHP type for this column is string,
		// we will cast the input to a string (if it is not).
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->url_identifier !== $v) {
			$this->url_identifier = $v;
			$this->modifiedColumns[] = NodeI18nPeer::URL_IDENTIFIER;
		}

	} // setUrlIdentifier()

	/**
	 * Set the value of [title] column.
	 * 
	 * @param      string $v new value
	 * @return     void
	 */
	public function setTitle($v)
	{

		// Since the native PHP type for this column is string,
		// we will cast the input to a string (if it is not).
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->title !== $v) {
			$this->title = $v;
			$this->modifiedColumns[] = NodeI18nPeer::TITLE;
		}

	} // setTitle()

	/**
	 * Set the value of [sub_title] column.
	 * 
	 * @param      string $v new value
	 * @return     void
	 */
	public function setSubTitle($v)
	{

		// Since the native PHP type for this column is string,
		// we will cast the input to a string (if it is not).
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->sub_title !== $v) {
			$this->sub_title = $v;
			$this->modifiedColumns[] = NodeI18nPeer::SUB_TITLE;
		}

	} // setSubTitle()

	/**
	 * Set the value of [browser_title_type] column.
	 * 
	 * @param      int $v new value
	 * @return     void
	 */
	public function setBrowserTitleType($v)
	{

		// Since the native PHP type for this column is integer,
		// we will cast the input value to an int (if it is not).
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->browser_title_type !== $v) {
			$this->browser_title_type = $v;
			$this->modifiedColumns[] = NodeI18nPeer::BROWSER_TITLE_TYPE;
		}

	} // setBrowserTitleType()

	/**
	 * Set the value of [browser_title_content] column.
	 * 
	 * @param      string $v new value
	 * @return     void
	 */
	public function setBrowserTitleContent($v)
	{

		// Since the native PHP type for this column is string,
		// we will cast the input to a string (if it is not).
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->browser_title_content !== $v) {
			$this->browser_title_content = $v;
			$this->modifiedColumns[] = NodeI18nPeer::BROWSER_TITLE_CONTENT;
		}

	} // setBrowserTitleContent()

	/**
	 * Set the value of [seo_keywords_type] column.
	 * 
	 * @param      int $v new value
	 * @return     void
	 */
	public function setSeoKeywordsType($v)
	{

		// Since the native PHP type for this column is integer,
		// we will cast the input value to an int (if it is not).
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->seo_keywords_type !== $v) {
			$this->seo_keywords_type = $v;
			$this->modifiedColumns[] = NodeI18nPeer::SEO_KEYWORDS_TYPE;
		}

	} // setSeoKeywordsType()

	/**
	 * Set the value of [seo_keywords_content] column.
	 * 
	 * @param      string $v new value
	 * @return     void
	 */
	public function setSeoKeywordsContent($v)
	{

		// Since the native PHP type for this column is string,
		// we will cast the input to a string (if it is not).
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->seo_keywords_content !== $v) {
			$this->seo_keywords_content = $v;
			$this->modifiedColumns[] = NodeI18nPeer::SEO_KEYWORDS_CONTENT;
		}

	} // setSeoKeywordsContent()

	/**
	 * Set the value of [seo_description_type] column.
	 * 
	 * @param      int $v new value
	 * @return     void
	 */
	public function setSeoDescriptionType($v)
	{

		// Since the native PHP type for this column is integer,
		// we will cast the input value to an int (if it is not).
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->seo_description_type !== $v) {
			$this->seo_description_type = $v;
			$this->modifiedColumns[] = NodeI18nPeer::SEO_DESCRIPTION_TYPE;
		}

	} // setSeoDescriptionType()

	/**
	 * Set the value of [seo_description_content] column.
	 * 
	 * @param      string $v new value
	 * @return     void
	 */
	public function setSeoDescriptionContent($v)
	{

		// Since the native PHP type for this column is string,
		// we will cast the input to a string (if it is not).
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->seo_description_content !== $v) {
			$this->seo_description_content = $v;
			$this->modifiedColumns[] = NodeI18nPeer::SEO_DESCRIPTION_CONTENT;
		}

	} // setSeoDescriptionContent()

	/**
	 * Set the value of [menu_title_type] column.
	 * 
	 * @param      int $v new value
	 * @return     void
	 */
	public function setMenuTitleType($v)
	{

		// Since the native PHP type for this column is integer,
		// we will cast the input value to an int (if it is not).
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->menu_title_type !== $v) {
			$this->menu_title_type = $v;
			$this->modifiedColumns[] = NodeI18nPeer::MENU_TITLE_TYPE;
		}

	} // setMenuTitleType()

	/**
	 * Set the value of [menu_title_content] column.
	 * 
	 * @param      string $v new value
	 * @return     void
	 */
	public function setMenuTitleContent($v)
	{

		// Since the native PHP type for this column is string,
		// we will cast the input to a string (if it is not).
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->menu_title_content !== $v) {
			$this->menu_title_content = $v;
			$this->modifiedColumns[] = NodeI18nPeer::MENU_TITLE_CONTENT;
		}

	} // setMenuTitleContent()

	/**
	 * Hydrates (populates) the object variables with values from the database resultset.
	 *
	 * An offset (1-based "start column") is specified so that objects can be hydrated
	 * with a subset of the columns in the resultset rows.  This is needed, for example,
	 * for results of JOIN queries where the resultset row includes columns from two or
	 * more tables.
	 *
	 * @param      ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
	 * @param      int $startcol 1-based offset column which indicates which restultset column to start with.
	 * @return     int next starting column
	 * @throws     PropelException  - Any caught Exception will be rewrapped as a PropelException.
	 */
	public function hydrate(ResultSet $rs, $startcol = 1)
	{
		try {

			$this->id = $rs->getInt($startcol + 0);

			$this->culture = $rs->getString($startcol + 1);

			$this->url_type = $rs->getInt($startcol + 2);

			$this->url_identifier = $rs->getString($startcol + 3);

			$this->title = $rs->getString($startcol + 4);

			$this->sub_title = $rs->getString($startcol + 5);

			$this->browser_title_type = $rs->getInt($startcol + 6);

			$this->browser_title_content = $rs->getString($startcol + 7);

			$this->seo_keywords_type = $rs->getInt($startcol + 8);

			$this->seo_keywords_content = $rs->getString($startcol + 9);

			$this->seo_description_type = $rs->getInt($startcol + 10);

			$this->seo_description_content = $rs->getString($startcol + 11);

			$this->menu_title_type = $rs->getInt($startcol + 12);

			$this->menu_title_content = $rs->getString($startcol + 13);

			$this->resetModified();

			$this->setNew(false);

			// FIXME - using NUM_COLUMNS may be clearer.
			return $startcol + 14; // 14 = NodeI18nPeer::NUM_COLUMNS - NodeI18nPeer::NUM_LAZY_LOAD_COLUMNS).

		} catch (Exception $e) {
			throw new PropelException("Error populating NodeI18n object", $e);
		}
	}

	/**
	 * Removes this object from datastore and sets delete attribute.
	 *
	 * @param      Connection $con
	 * @return     void
	 * @throws     PropelException
	 * @see        BaseObject::setDeleted()
	 * @see        BaseObject::isDeleted()
	 */
	public function delete($con = null)
	{

    foreach (sfMixer::getCallables('BaseNodeI18n:delete:pre') as $callable)
    {
      $ret = call_user_func($callable, $this, $con);
      if ($ret)
      {
        return;
      }
    }


		if ($this->isDeleted()) {
			throw new PropelException("This object has already been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(NodeI18nPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			NodeI18nPeer::doDelete($this, $con);
			$this->setDeleted(true);
			$con->commit();
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	

    foreach (sfMixer::getCallables('BaseNodeI18n:delete:post') as $callable)
    {
      call_user_func($callable, $this, $con);
    }

  }
	/**
	 * Stores the object in the database.  If the object is new,
	 * it inserts it; otherwise an update is performed.  This method
	 * wraps the doSave() worker method in a transaction.
	 *
	 * @param      Connection $con
	 * @return     int The number of rows affected by this insert/update and any referring fk objects' save() operations.
	 * @throws     PropelException
	 * @see        doSave()
	 */
	public function save($con = null)
	{

    foreach (sfMixer::getCallables('BaseNodeI18n:save:pre') as $callable)
    {
      $affectedRows = call_user_func($callable, $this, $con);
      if (is_int($affectedRows))
      {
        return $affectedRows;
      }
    }


		if ($this->isDeleted()) {
			throw new PropelException("You cannot save an object that has been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(NodeI18nPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			$affectedRows = $this->doSave($con);
			$con->commit();
    foreach (sfMixer::getCallables('BaseNodeI18n:save:post') as $callable)
    {
      call_user_func($callable, $this, $con, $affectedRows);
    }

			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	/**
	 * Stores the object in the database.
	 *
	 * If the object is new, it inserts it; otherwise an update is performed.
	 * All related objects are also updated in this method.
	 *
	 * @param      Connection $con
	 * @return     int The number of rows affected by this insert/update and any referring fk objects' save() operations.
	 * @throws     PropelException
	 * @see        save()
	 */
	protected function doSave($con)
	{
		$affectedRows = 0; // initialize var to track total num of affected rows
		if (!$this->alreadyInSave) {
			$this->alreadyInSave = true;


			// We call the save method on the following object(s) if they
			// were passed to this object by their coresponding set
			// method.  This object relates to these object(s) by a
			// foreign key reference.

			if ($this->aNode !== null) {
				if ($this->aNode->isModified() || ($this->aNode->getCulture() && $this->aNode->getCurrentNodeI18n()->isModified())) {
					$affectedRows += $this->aNode->save($con);
				}
				$this->setNode($this->aNode);
			}


			// If this object has been modified, then save it to the database.
			if ($this->isModified()) {
				if ($this->isNew()) {
					$pk = NodeI18nPeer::doInsert($this, $con);
					$affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
										 // should always be true here (even though technically
										 // BasePeer::doInsert() can insert multiple rows).

					$this->setNew(false);
				} else {
					$affectedRows += NodeI18nPeer::doUpdate($this, $con);
				}
				$this->resetModified(); // [HL] After being saved an object is no longer 'modified'
			}

			$this->alreadyInSave = false;
		}
		return $affectedRows;
	} // doSave()

	/**
	 * Array of ValidationFailed objects.
	 * @var        array ValidationFailed[]
	 */
	protected $validationFailures = array();

	/**
	 * Gets any ValidationFailed objects that resulted from last call to validate().
	 *
	 *
	 * @return     array ValidationFailed[]
	 * @see        validate()
	 */
	public function getValidationFailures()
	{
		return $this->validationFailures;
	}

	/**
	 * Validates the objects modified field values and all objects related to this table.
	 *
	 * If $columns is either a column name or an array of column names
	 * only those columns are validated.
	 *
	 * @param      mixed $columns Column name or an array of column names.
	 * @return     boolean Whether all columns pass validation.
	 * @see        doValidate()
	 * @see        getValidationFailures()
	 */
	public function validate($columns = null)
	{
		$res = $this->doValidate($columns);
		if ($res === true) {
			$this->validationFailures = array();
			return true;
		} else {
			$this->validationFailures = $res;
			return false;
		}
	}

	/**
	 * This function performs the validation work for complex object models.
	 *
	 * In addition to checking the current object, all related objects will
	 * also be validated.  If all pass then <code>true</code> is returned; otherwise
	 * an aggreagated array of ValidationFailed objects will be returned.
	 *
	 * @param      array $columns Array of column names to validate.
	 * @return     mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise.
	 */
	protected function doValidate($columns = null)
	{
		if (!$this->alreadyInValidation) {
			$this->alreadyInValidation = true;
			$retval = null;

			$failureMap = array();


			// We call the validate method on the following object(s) if they
			// were passed to this object by their coresponding set
			// method.  This object relates to these object(s) by a
			// foreign key reference.

			if ($this->aNode !== null) {
				if (!$this->aNode->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aNode->getValidationFailures());
				}
			}


			if (($retval = NodeI18nPeer::doValidate($this, $columns)) !== true) {
				$failureMap = array_merge($failureMap, $retval);
			}



			$this->alreadyInValidation = false;
		}

		return (!empty($failureMap) ? $failureMap : true);
	}

	/**
	 * Retrieves a field from the object by name passed in as a string.
	 *
	 * @param      string $name name
	 * @param      string $type The type of fieldname the $name is of:
	 *                     one of the class type constants TYPE_PHPNAME,
	 *                     TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
	 * @return     mixed Value of field.
	 */
	public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = NodeI18nPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->getByPosition($pos);
	}

	/**
	 * Retrieves a field from the object by Position as specified in the xml schema.
	 * Zero-based.
	 *
	 * @param      int $pos position in xml schema
	 * @return     mixed Value of field at $pos
	 */
	public function getByPosition($pos)
	{
		switch($pos) {
			case 0:
				return $this->getId();
				break;
			case 1:
				return $this->getCulture();
				break;
			case 2:
				return $this->getUrlType();
				break;
			case 3:
				return $this->getUrlIdentifier();
				break;
			case 4:
				return $this->getTitle();
				break;
			case 5:
				return $this->getSubTitle();
				break;
			case 6:
				return $this->getBrowserTitleType();
				break;
			case 7:
				return $this->getBrowserTitleContent();
				break;
			case 8:
				return $this->getSeoKeywordsType();
				break;
			case 9:
				return $this->getSeoKeywordsContent();
				break;
			case 10:
				return $this->getSeoDescriptionType();
				break;
			case 11:
				return $this->getSeoDescriptionContent();
				break;
			case 12:
				return $this->getMenuTitleType();
				break;
			case 13:
				return $this->getMenuTitleContent();
				break;
			default:
				return null;
				break;
		} // switch()
	}

	/**
	 * Exports the object as an array.
	 *
	 * You can specify the key type of the array by passing one of the class
	 * type constants.
	 *
	 * @param      string $keyType One of the class type constants TYPE_PHPNAME,
	 *                        TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
	 * @return     an associative array containing the field names (as keys) and field values
	 */
	public function toArray($keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = NodeI18nPeer::getFieldNames($keyType);
		$result = array(
			$keys[0] => $this->getId(),
			$keys[1] => $this->getCulture(),
			$keys[2] => $this->getUrlType(),
			$keys[3] => $this->getUrlIdentifier(),
			$keys[4] => $this->getTitle(),
			$keys[5] => $this->getSubTitle(),
			$keys[6] => $this->getBrowserTitleType(),
			$keys[7] => $this->getBrowserTitleContent(),
			$keys[8] => $this->getSeoKeywordsType(),
			$keys[9] => $this->getSeoKeywordsContent(),
			$keys[10] => $this->getSeoDescriptionType(),
			$keys[11] => $this->getSeoDescriptionContent(),
			$keys[12] => $this->getMenuTitleType(),
			$keys[13] => $this->getMenuTitleContent(),
		);
		return $result;
	}

	/**
	 * Sets a field from the object by name passed in as a string.
	 *
	 * @param      string $name peer name
	 * @param      mixed $value field value
	 * @param      string $type The type of fieldname the $name is of:
	 *                     one of the class type constants TYPE_PHPNAME,
	 *                     TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
	 * @return     void
	 */
	public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = NodeI18nPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->setByPosition($pos, $value);
	}

	/**
	 * Sets a field from the object by Position as specified in the xml schema.
	 * Zero-based.
	 *
	 * @param      int $pos position in xml schema
	 * @param      mixed $value field value
	 * @return     void
	 */
	public function setByPosition($pos, $value)
	{
		switch($pos) {
			case 0:
				$this->setId($value);
				break;
			case 1:
				$this->setCulture($value);
				break;
			case 2:
				$this->setUrlType($value);
				break;
			case 3:
				$this->setUrlIdentifier($value);
				break;
			case 4:
				$this->setTitle($value);
				break;
			case 5:
				$this->setSubTitle($value);
				break;
			case 6:
				$this->setBrowserTitleType($value);
				break;
			case 7:
				$this->setBrowserTitleContent($value);
				break;
			case 8:
				$this->setSeoKeywordsType($value);
				break;
			case 9:
				$this->setSeoKeywordsContent($value);
				break;
			case 10:
				$this->setSeoDescriptionType($value);
				break;
			case 11:
				$this->setSeoDescriptionContent($value);
				break;
			case 12:
				$this->setMenuTitleType($value);
				break;
			case 13:
				$this->setMenuTitleContent($value);
				break;
		} // switch()
	}

	/**
	 * Populates the object using an array.
	 *
	 * This is particularly useful when populating an object from one of the
	 * request arrays (e.g. $_POST).  This method goes through the column
	 * names, checking to see whether a matching key exists in populated
	 * array. If so the setByName() method is called for that column.
	 *
	 * You can specify the key type of the array by additionally passing one
	 * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
	 * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
	 *
	 * @param      array  $arr     An array to populate the object from.
	 * @param      string $keyType The type of keys the array uses.
	 * @return     void
	 */
	public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = NodeI18nPeer::getFieldNames($keyType);

		if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
		if (array_key_exists($keys[1], $arr)) $this->setCulture($arr[$keys[1]]);
		if (array_key_exists($keys[2], $arr)) $this->setUrlType($arr[$keys[2]]);
		if (array_key_exists($keys[3], $arr)) $this->setUrlIdentifier($arr[$keys[3]]);
		if (array_key_exists($keys[4], $arr)) $this->setTitle($arr[$keys[4]]);
		if (array_key_exists($keys[5], $arr)) $this->setSubTitle($arr[$keys[5]]);
		if (array_key_exists($keys[6], $arr)) $this->setBrowserTitleType($arr[$keys[6]]);
		if (array_key_exists($keys[7], $arr)) $this->setBrowserTitleContent($arr[$keys[7]]);
		if (array_key_exists($keys[8], $arr)) $this->setSeoKeywordsType($arr[$keys[8]]);
		if (array_key_exists($keys[9], $arr)) $this->setSeoKeywordsContent($arr[$keys[9]]);
		if (array_key_exists($keys[10], $arr)) $this->setSeoDescriptionType($arr[$keys[10]]);
		if (array_key_exists($keys[11], $arr)) $this->setSeoDescriptionContent($arr[$keys[11]]);
		if (array_key_exists($keys[12], $arr)) $this->setMenuTitleType($arr[$keys[12]]);
		if (array_key_exists($keys[13], $arr)) $this->setMenuTitleContent($arr[$keys[13]]);
	}

	/**
	 * Build a Criteria object containing the values of all modified columns in this object.
	 *
	 * @return     Criteria The Criteria object containing all modified values.
	 */
	public function buildCriteria()
	{
		$criteria = new Criteria(NodeI18nPeer::DATABASE_NAME);

		if ($this->isColumnModified(NodeI18nPeer::ID)) $criteria->add(NodeI18nPeer::ID, $this->id);
		if ($this->isColumnModified(NodeI18nPeer::CULTURE)) $criteria->add(NodeI18nPeer::CULTURE, $this->culture);
		if ($this->isColumnModified(NodeI18nPeer::URL_TYPE)) $criteria->add(NodeI18nPeer::URL_TYPE, $this->url_type);
		if ($this->isColumnModified(NodeI18nPeer::URL_IDENTIFIER)) $criteria->add(NodeI18nPeer::URL_IDENTIFIER, $this->url_identifier);
		if ($this->isColumnModified(NodeI18nPeer::TITLE)) $criteria->add(NodeI18nPeer::TITLE, $this->title);
		if ($this->isColumnModified(NodeI18nPeer::SUB_TITLE)) $criteria->add(NodeI18nPeer::SUB_TITLE, $this->sub_title);
		if ($this->isColumnModified(NodeI18nPeer::BROWSER_TITLE_TYPE)) $criteria->add(NodeI18nPeer::BROWSER_TITLE_TYPE, $this->browser_title_type);
		if ($this->isColumnModified(NodeI18nPeer::BROWSER_TITLE_CONTENT)) $criteria->add(NodeI18nPeer::BROWSER_TITLE_CONTENT, $this->browser_title_content);
		if ($this->isColumnModified(NodeI18nPeer::SEO_KEYWORDS_TYPE)) $criteria->add(NodeI18nPeer::SEO_KEYWORDS_TYPE, $this->seo_keywords_type);
		if ($this->isColumnModified(NodeI18nPeer::SEO_KEYWORDS_CONTENT)) $criteria->add(NodeI18nPeer::SEO_KEYWORDS_CONTENT, $this->seo_keywords_content);
		if ($this->isColumnModified(NodeI18nPeer::SEO_DESCRIPTION_TYPE)) $criteria->add(NodeI18nPeer::SEO_DESCRIPTION_TYPE, $this->seo_description_type);
		if ($this->isColumnModified(NodeI18nPeer::SEO_DESCRIPTION_CONTENT)) $criteria->add(NodeI18nPeer::SEO_DESCRIPTION_CONTENT, $this->seo_description_content);
		if ($this->isColumnModified(NodeI18nPeer::MENU_TITLE_TYPE)) $criteria->add(NodeI18nPeer::MENU_TITLE_TYPE, $this->menu_title_type);
		if ($this->isColumnModified(NodeI18nPeer::MENU_TITLE_CONTENT)) $criteria->add(NodeI18nPeer::MENU_TITLE_CONTENT, $this->menu_title_content);

		return $criteria;
	}

	/**
	 * Builds a Criteria object containing the primary key for this object.
	 *
	 * Unlike buildCriteria() this method includes the primary key values regardless
	 * of whether or not they have been modified.
	 *
	 * @return     Criteria The Criteria object containing value(s) for primary key(s).
	 */
	public function buildPkeyCriteria()
	{
		$criteria = new Criteria(NodeI18nPeer::DATABASE_NAME);

		$criteria->add(NodeI18nPeer::ID, $this->id);
		$criteria->add(NodeI18nPeer::CULTURE, $this->culture);

		return $criteria;
	}

	/**
	 * Returns the composite primary key for this object.
	 * The array elements will be in same order as specified in XML.
	 * @return     array
	 */
	public function getPrimaryKey()
	{
		$pks = array();

		$pks[0] = $this->getId();

		$pks[1] = $this->getCulture();

		return $pks;
	}

	/**
	 * Set the [composite] primary key.
	 *
	 * @param      array $keys The elements of the composite key (order must match the order in XML file).
	 * @return     void
	 */
	public function setPrimaryKey($keys)
	{

		$this->setId($keys[0]);

		$this->setCulture($keys[1]);

	}

	/**
	 * Sets contents of passed object to values from current object.
	 *
	 * If desired, this method can also make copies of all associated (fkey referrers)
	 * objects.
	 *
	 * @param      object $copyObj An object of NodeI18n (or compatible) type.
	 * @param      boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
	 * @throws     PropelException
	 */
	public function copyInto($copyObj, $deepCopy = false)
	{

		$copyObj->setUrlType($this->url_type);

		$copyObj->setUrlIdentifier($this->url_identifier);

		$copyObj->setTitle($this->title);

		$copyObj->setSubTitle($this->sub_title);

		$copyObj->setBrowserTitleType($this->browser_title_type);

		$copyObj->setBrowserTitleContent($this->browser_title_content);

		$copyObj->setSeoKeywordsType($this->seo_keywords_type);

		$copyObj->setSeoKeywordsContent($this->seo_keywords_content);

		$copyObj->setSeoDescriptionType($this->seo_description_type);

		$copyObj->setSeoDescriptionContent($this->seo_description_content);

		$copyObj->setMenuTitleType($this->menu_title_type);

		$copyObj->setMenuTitleContent($this->menu_title_content);


		$copyObj->setNew(true);

		$copyObj->setId(NULL); // this is a pkey column, so set to default value

		$copyObj->setCulture(NULL); // this is a pkey column, so set to default value

	}

	/**
	 * Makes a copy of this object that will be inserted as a new row in table when saved.
	 * It creates a new object filling in the simple attributes, but skipping any primary
	 * keys that are defined for the table.
	 *
	 * If desired, this method can also make copies of all associated (fkey referrers)
	 * objects.
	 *
	 * @param      boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
	 * @return     NodeI18n Clone of current object.
	 * @throws     PropelException
	 */
	public function copy($deepCopy = false)
	{
		// we use get_class(), because this might be a subclass
		$clazz = get_class($this);
		$copyObj = new $clazz();
		$this->copyInto($copyObj, $deepCopy);
		return $copyObj;
	}

	/**
	 * Returns a peer instance associated with this om.
	 *
	 * Since Peer classes are not to have any instance attributes, this method returns the
	 * same instance for all member of this class. The method could therefore
	 * be static, but this would prevent one from overriding the behavior.
	 *
	 * @return     NodeI18nPeer
	 */
	public function getPeer()
	{
		if (self::$peer === null) {
			self::$peer = new NodeI18nPeer();
		}
		return self::$peer;
	}

	/**
	 * Declares an association between this object and a Node object.
	 *
	 * @param      Node $v
	 * @return     void
	 * @throws     PropelException
	 */
	public function setNode($v)
	{


		if ($v === null) {
			$this->setId(NULL);
		} else {
			$this->setId($v->getId());
		}


		$this->aNode = $v;
	}


	/**
	 * Get the associated Node object
	 *
	 * @param      Connection Optional Connection object.
	 * @return     Node The associated Node object.
	 * @throws     PropelException
	 */
	public function getNode($con = null)
	{
		if ($this->aNode === null && ($this->id !== null)) {
			// include the related Peer class
			$this->aNode = NodePeer::retrieveByPK($this->id, $con);

			/* The following can be used instead of the line above to
			   guarantee the related object contains a reference
			   to this object, but this level of coupling
			   may be undesirable in many circumstances.
			   As it can lead to a db query with many results that may
			   never be used.
			   $obj = NodePeer::retrieveByPK($this->id, $con);
			   $obj->addNodes($this);
			 */
		}
		return $this->aNode;
	}


  public function __call($method, $arguments)
  {
    if (!$callable = sfMixer::getCallable('BaseNodeI18n:'.$method))
    {
      throw new sfException(sprintf('Call to undefined method BaseNodeI18n::%s', $method));
    }

    array_unshift($arguments, $this);

    return call_user_func_array($callable, $arguments);
  }


} // BaseNodeI18n
