当前位置: 首页>>代码示例>>PHP>>正文


PHP JTableNested::bind方法代码示例

本文整理汇总了PHP中JTableNested::bind方法的典型用法代码示例。如果您正苦于以下问题:PHP JTableNested::bind方法的具体用法?PHP JTableNested::bind怎么用?PHP JTableNested::bind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JTableNested的用法示例。


在下文中一共展示了JTableNested::bind方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: bind

 /**
  * Overloaded bind function to pre-process the params.
  *
  * @param    array        Named array
  * @return   null|string  null is operation was satisfactory, otherwise returns an error
  * @see      JTable:bind
  */
 public function bind($array, $ignore = '')
 {
     // for Fields group
     // Convert jform[fields_group][field] to jform[field] or JTable cannot bind data.
     // ==========================================================================================
     $data = array();
     $array = AKHelper::_('array.pivotFromTwoDimension', $array);
     // Set field['param_xxx'] to params
     // ==========================================================================================
     if (empty($array['params'])) {
         $array['params'] = AKHelper::_('array.pivotFromPrefix', 'param_', $array, JArrayHelper::getValue($array, 'params', array()));
     }
     // set params to JRegistry
     // ==========================================================================================
     if (isset($array['params']) && is_array($array['params'])) {
         $registry = new JRegistry();
         $registry->loadArray($array['params']);
         $array['params'] = (string) $registry;
     }
     // Bind the rules.
     // ==========================================================================================
     if (isset($array['rules']) && is_array($array['rules'])) {
         $rules = new JAccessRules($array['rules']);
         $this->setRules($rules);
     }
     return parent::bind($array, $ignore);
 }
开发者ID:ForAEdesWeb,项目名称:AEW3,代码行数:34,代码来源:tablenested.php

示例2: bind

	/**
	 * Overloaded bind function
	 *
	 * @param   array  $array   Named array
	 * @param   mixed  $ignore  An optional array or space separated list of properties to ignore while binding.
	 *
	 * @return  mixed  Null if operation was satisfactory, otherwise returns an error
	 *
	 * @see     JTable:bind
	 * @since   11.1
	 */
	public function bind($array, $ignore = '')
	{
		// Verify that the default home menu is not unset
		if ($this->home == '1' && $this->language == '*' && ($array['home'] == '0'))
		{
			$this->setError(JText::_('JLIB_DATABASE_ERROR_MENU_CANNOT_UNSET_DEFAULT_DEFAULT'));
			return false;
		}
		//Verify that the default home menu set to "all" languages" is not unset
		if ($this->home == '1' && $this->language == '*' && ($array['language'] != '*'))
		{
			$this->setError(JText::_('JLIB_DATABASE_ERROR_MENU_CANNOT_UNSET_DEFAULT'));
			return false;
		}

		// Verify that the default home menu is not unpublished
		if ($this->home == '1' && $this->language == '*' && $array['published'] != '1')
		{
			$this->setError(JText::_('JLIB_DATABASE_ERROR_MENU_UNPUBLISH_DEFAULT_HOME'));
			return false;
		}

		if (isset($array['params']) && is_array($array['params']))
		{
			$registry = new JRegistry();
			$registry->loadArray($array['params']);
			$array['params'] = (string) $registry;
		}

		return parent::bind($array, $ignore);
	}
开发者ID:nikosdion,项目名称:Akeeba-Example,代码行数:42,代码来源:menu.php

示例3: bind

 public function bind($array, $ignore = '')
 {
     if (isset($array['params']) && is_array($array['params'])) {
         $registry = new JRegistry();
         $registry->loadArray($array['params']);
         $array['params'] = (string) $registry;
     }
     return parent::bind($array, $ignore);
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:9,代码来源:addon.php

示例4: bind

 public function bind($array, $ignore = '')
 {
     if (isset($array['params']) && is_array($array['params'])) {
         $registry = new JRegistry();
         $registry->loadArray($array['params']);
         $array['params'] = (string) $registry;
     }
     $bind = parent::bind($array, $ignore);
     if ($this->parent_id == 0) {
         $this->Set('parent_id', $this->getRootId());
     }
     return $bind;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:13,代码来源:membership.php

示例5: bind

 /**
  * Overloaded bind function
  *
  * @param   array  $array   Named array
  * @param   mixed  $ignore  An optional array or space separated list of properties
  * to ignore while binding.
  *
  * @return  mixed  Null if operation was satisfactory, otherwise returns an error string
  *
  * @see     JTable::bind
  * @since   3.1
  */
 public function bind($array, $ignore = '')
 {
     if (isset($array['params']) && is_array($array['params'])) {
         $registry = new Registry($array['params']);
         $array['params'] = (string) $registry;
     }
     if (isset($array['metadata']) && is_array($array['metadata'])) {
         $registry = new Registry($array['metadata']);
         $array['metadata'] = (string) $registry;
     }
     if (isset($array['urls']) && is_array($array['urls'])) {
         $registry = new Registry($array['urls']);
         $array['urls'] = (string) $registry;
     }
     if (isset($array['images']) && is_array($array['images'])) {
         $registry = new Registry($array['images']);
         $array['images'] = (string) $registry;
     }
     return parent::bind($array, $ignore);
 }
开发者ID:eshiol,项目名称:joomla-cms,代码行数:32,代码来源:tag.php

示例6: bind

 /**
  * Method to bind an associative array or object to the JTable instance.This
  * method only binds properties that are publicly accessible and optionally
  * takes an array of properties to ignore when binding.
  *
  * @param   mixed  $src     An associative array or object to bind to the JTable instance.
  * @param   mixed  $ignore  An optional array or space separated list of properties to ignore while binding.
  *
  * @return  boolean  True on success.
  *
  * @throws  InvalidArgumentException
  */
 public function bind($src, $ignore = array())
 {
     if (isset($src['params']) && is_array($src['params'])) {
         $registry = new JRegistry();
         $registry->loadArray($src['params']);
         $src['params'] = (string) $registry;
     }
     if (isset($src['metadata']) && is_array($src['metadata'])) {
         $registry = new JRegistry();
         $registry->loadArray($src['metadata']);
         $src['metadata'] = (string) $registry;
     }
     if (isset($src['rules']) && is_array($src['rules'])) {
         $rules = new JAccessRules($src['rules']);
         $this->setRules($rules);
     }
     return parent::bind($src, $ignore);
 }
开发者ID:prox91,项目名称:joomla-dev,代码行数:30,代码来源:nested.php

示例7: bind

 /**
  * Overloaded bind function.
  *
  * @param   array   $array   named array
  * @param   string  $ignore  An optional array or space separated list of properties
  *                           to ignore while binding.
  *
  * @return  mixed   Null if operation was satisfactory, otherwise returns an error
  *
  * @see     JTable::bind()
  * @since   11.1
  */
 public function bind($array, $ignore = '')
 {
     if (isset($array['params']) && is_array($array['params'])) {
         $registry = new Registry($array['params']);
         $array['params'] = (string) $registry;
     }
     if (isset($array['metadata']) && is_array($array['metadata'])) {
         $registry = new Registry($array['metadata']);
         $array['metadata'] = (string) $registry;
     }
     // Bind the rules.
     if (isset($array['rules']) && is_array($array['rules'])) {
         $rules = new JAccessRules($array['rules']);
         $this->setRules($rules);
     }
     return parent::bind($array, $ignore);
 }
开发者ID:eshiol,项目名称:joomla-cms,代码行数:29,代码来源:category.php

示例8: bind

 /**
  * Method to bind an associative array or object to the JTable instance.
  *
  * @see JTable
  */
 public function bind($array, $ignore = '')
 {
     if (isset($array['name'])) {
         $array['name'] = str_replace(' ', '_', strtolower($array['name']));
     }
     // If this table has a column named 'options', save all param fields as JSON string in this column
     if (isset($array['options']) && is_array($array['options'])) {
         ksort($array["options"]);
         $options = array("keys" => array(), "values" => array());
         for ($i = 0; $i < count($array["options"]["keys"]); $i++) {
             if ($array["options"]["keys"][$i] != "") {
                 $options["keys"][] = $array["options"]["keys"][$i];
                 $options["values"][] = $array["options"]["values"][$i];
             }
         }
         $registry = new JRegistry();
         $registry->loadArray($options);
         $array['options'] = (string) $registry;
     }
     // If this table has a column named 'attributes', save all param fields as JSON string in this column
     if (isset($array['attributes']) && is_array($array['attributes'])) {
         ksort($array["attributes"]);
         $attributes = array("keys" => array(), "values" => array());
         for ($i = 0; $i < count($array["attributes"]["keys"]); $i++) {
             if ($array["attributes"]["keys"][$i] != "") {
                 $attributes["keys"][] = $array["attributes"]["keys"][$i];
                 $attributes["values"][] = $array["attributes"]["values"][$i];
             }
         }
         $registry = new JRegistry();
         $registry->loadArray($attributes);
         $array['attributes'] = (string) $registry;
     }
     // If this table has a column named 'params', save all param fields as JSON string in this column
     if (isset($array['params']) && is_array($array['params'])) {
         $registry = new JRegistry();
         $registry->loadArray($array['params']);
         $array['params'] = (string) $registry;
     }
     return parent::bind($array, $ignore);
 }
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:46,代码来源:form.php

示例9: bind

 /**
  * Method to bind an associative array or object to the JTable instance.This
  * method only binds properties that are publicly accessible and optionally
  * takes an array of properties to ignore when binding.
  *
  * @param   mixed  $src     An associative array or object to bind to the JTable instance.
  * @param   mixed  $ignore  An optional array or space separated list of properties to ignore while binding.
  *
  * @return  boolean  True on success.
  *
  * @link    http://docs.joomla.org/JTable/bind
  * @since   11.1
  * @throws  InvalidArgumentException
  */
 public function bind($src, $ignore = array())
 {
     if (is_object($src)) {
         $src = get_object_vars($src);
     }
     if (isset($src['params']) && is_array($src['params'])) {
         $registry = new JRegistry();
         $registry->loadArray($src['params']);
         $src['params'] = $registry->toString();
     }
     if (isset($src['plugins']) && is_array($src['plugins'])) {
         $registry = new JRegistry();
         $registry->loadArray($src['plugins']);
         $src['plugins'] = $registry->toString();
     }
     if (isset($src['rules']) && is_array($src['rules'])) {
         $rules = array();
         foreach ((array) $src['rules'] as $action => $ids) {
             $rules[$action] = array();
             foreach ($ids as $id => $p) {
                 if ($p !== '') {
                     $rules[$action][$id] = $p == '1' || $p == 'true' ? true : false;
                 }
             }
         }
         $this->setRules(new JAccessRules($rules));
     }
     return parent::bind($src, $ignore);
 }
开发者ID:Naldo100,项目名称:k2-v3-dev-build,代码行数:43,代码来源:nested.php

示例10: bind

 public function bind($array, $ignore = '')
 {
     return parent::bind($array, $ignore);
 }
开发者ID:hixbotay,项目名称:executivetransport,代码行数:4,代码来源:airport.php


注:本文中的JTableNested::bind方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。