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


PHP DatabaseObject::create方法代码示例

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


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

示例1: create

 /**
  * Create a translation of a phrase.  If the phrase ID is set in the
  * constructor, we assume that the phrase already exists and we are
  * just creating a translation, and not a new phrase.
  *
  * @param string $p_text
  * 		Optional. The translation text.
  * @return boolean
  */
 public function create($p_text = null)
 {
     if (!isset($this->m_data['phrase_id'])) {
         $this->m_data['phrase_id'] = Translation::__GeneratePhraseId();
     }
     return parent::create(array("translation_text" => $p_text));
 }
开发者ID:sourcefabric,项目名称:newscoop,代码行数:16,代码来源:Translation.php

示例2: create

 /**
  * Create the language.  Creates the directory on disk to store the
  * translation files.
  *
  * @param array $p_values
  * @return mixed
  * 		Return TRUE on success and PEAR_Error on failure.
  */
 public function create($p_values = null)
 {
     $success = parent::create($p_values);
     if ($success) {
         CampCache::singleton()->clear('user');
     }
     return $success;
 }
开发者ID:sourcefabric,项目名称:newscoop,代码行数:16,代码来源:Language.php

示例3: create

 public function create($p_article_no)
 {
     if (empty($p_article_no)) {
         return false;
     }
     $columns['fk_article_no'] = (int) $p_article_no;
     $result = parent::create($columns);
     return $result;
 }
开发者ID:nidzix,项目名称:Newscoop,代码行数:9,代码来源:ContextBox.php

示例4: create

 /**
  * Create an issue.
  * @param string $p_shortName
  * @param array $p_values
  * @return boolean
  */
 public function create($p_shortName, $p_values = null)
 {
     $tmpValues = array('ShortName' => $p_shortName);
     if (!is_null($p_values)) {
         $tmpValues = array_merge($p_values, $tmpValues);
     }
     $success = parent::create($tmpValues);
     return $success;
 }
开发者ID:nidzix,项目名称:Newscoop,代码行数:15,代码来源:Issue.php

示例5: create

 /**
  * @param string $p_name
  * @return bool
  */
 public function create($p_name = null)
 {
     if (empty($p_name)) {
         return false;
     }
     $columns['type'] = (string) $p_name;
     $result = parent::create($columns);
     return $result;
 }
开发者ID:sourcefabric,项目名称:newscoop,代码行数:13,代码来源:AuthorType.php

示例6: create

 public function create($p_name, $p_version, $p_enabled = true)
 {
     // Create the record
     $this->m_data['Name'] = $p_name;
     $values = array('Version' => $p_version, 'Enabled' => $p_enabled ? 1 : 0);
     $success = parent::create($values);
     if (!$success) {
         return false;
     }
 }
开发者ID:nidzix,项目名称:Newscoop,代码行数:10,代码来源:CampPlugin.php

示例7: create

  	/**
  	 * @param array $p_values
  	 * @return boolean
  	 */
  	public function create($p_values = null)
  	{
  		$success = parent::create($p_values);
  		$publicationObj = new Publication($this->m_data['IdPublication']);
		if (function_exists("camp_load_translation_strings")) {
			camp_load_translation_strings("api");
		}
		$logtext = getGS('The default subscription time for ($1 "$2":$3) has been added.', getGS("Publication"), $publicationObj->getName(), $this->m_data['CountryCode']);
		Log::Message($logtext, null, 4);
		return $success;
  	} // fn create
开发者ID:nistormihai,项目名称:Newscoop,代码行数:15,代码来源:SubscriptionDefaultTime.php

示例8: create

	public function create($p_values = null)
	{
		$success = parent::create($p_values);
		if ($success) {
			if (function_exists("camp_load_translation_strings")) {
				camp_load_translation_strings("api");
			}
			$logtext = getGS('Country $1 added', $this->m_data['Name']." (".$this->m_data['Code'].")");
			Log::Message($logtext, null, 131);
		}
		return $success;
	} // fn create
开发者ID:nistormihai,项目名称:Newscoop,代码行数:12,代码来源:Country.php

示例9: create

    /**
     * Create an link blogentry <-> topic record in the database.
     *
     * @return void
     */
    function create()
    {
        global $g_ado_db;

        // Create the record
        $success = parent::create();
        if (!$success) {
            return;
        }
        $CampCache = CampCache::singleton();
        $CampCache->clear('user');
        return true;
    } // fn create
开发者ID:nistormihai,项目名称:Newscoop,代码行数:18,代码来源:BlogentryTopic.php

示例10: create

 /**
  * Create the language.  Creates the directory on disk to store the
  * translation files.
  *
  * @param array $p_values
  * @return mixed
  * 		Return TRUE on success and PEAR_Error on failure.
  */
 public function create($p_values = null)
 {
     $success = parent::create($p_values);
     if ($success) {
         $result = Localizer::CreateLanguageFiles($this->m_data['Code']);
         if (PEAR::isError($result)) {
             $this->delete(false);
             return $result;
         }
         CampCache::singleton()->clear('user');
     }
     return $success;
 }
开发者ID:nidzix,项目名称:Newscoop,代码行数:21,代码来源:Language.php

示例11: create

 public function create($p_article_id, $p_track_id, $p_track_data)
 {
     if (empty($p_article_id) || empty($p_track_id) || empty($p_track_data)) {
         return false;
     }
     $values = array('article_id' => $p_article_id, 'track_id' => $p_track_id, 'track_data' => serialize($p_track_data));
     $success = parent::create($values);
     if (!$success) {
         return false;
     }
     $CampCache = CampCache::singleton();
     $CampCache->clear('user');
     return true;
 }
开发者ID:nidzix,项目名称:Newscoop,代码行数:14,代码来源:Soundcloud.php

示例12: create

 /**
  * Create a new Section.
  * @param string $p_name
  * @param string $p_shortName
  */
 public function create($p_name, $p_shortName, $p_columns = null)
 {
     if (!is_array($p_columns)) {
         $p_columns = array();
     }
     $p_columns['Name'] = $p_name;
     $p_columns['ShortName'] = $p_shortName;
     $success = parent::create($p_columns);
     if ($success) {
         global $g_ado_db;
         $sql = "UPDATE `Sections` s" . " JOIN `Issues` AS i ON i.`IdPublication` = s.`IdPublication` AND i.`Number` = s.`NrIssue` AND i.`IdLanguage` = s.`IdLanguage`" . " SET `fk_issue_id` = i.`id` WHERE " . " s.`IdPublication` = " . $this->m_data['IdPublication'] . " AND s.`NrIssue` = " . $this->m_data['NrIssue'] . " AND s.`Number` = " . $this->m_data['Number'] . " AND s.`IdLanguage` = " . $this->m_data['IdLanguage'];
         $g_ado_db->Execute($sql);
     }
     return $success;
 }
开发者ID:nidzix,项目名称:Newscoop,代码行数:20,代码来源:Section.php

示例13: create

 /**
  * @param string $p_name
  * @return bool
  */
 public function create($p_name)
 {
     if (empty($p_name)) {
         return false;
     }
     $columns['type'] = (string) $p_name;
     $result = parent::create($columns);
     if ($result) {
         if (function_exists("camp_load_translation_strings")) {
             camp_load_translation_strings("api");
         }
         $logText = getGS('Author type "$1" created.', $p_name);
         Log::Message($logText, null, 175);
     }
     return $result;
 }
开发者ID:nistormihai,项目名称:Newscoop,代码行数:20,代码来源:AuthorType.php

示例14: create

	/**
	 * Create the language.  Creates the directory on disk to store the
	 * translation files.
	 *
	 * @param array $p_values
	 * @return mixed
	 * 		Return TRUE on success and PEAR_Error on failure.
	 */
	public function create($p_values = null)
	{
		$success = parent::create($p_values);
		if ($success) {
		        $result = Localizer::CreateLanguageFiles($this->m_data['Code']);
			if (PEAR::isError($result)) {
			        $this->delete(false);
				return $result;
			}
			CampCache::singleton()->clear('user');
			if (function_exists("camp_load_translation_strings")) {
			        camp_load_translation_strings("api");
			}
			$logtext = getGS('Language "$1" ($2) added', $this->m_data['Name'], $this->m_data['OrigName']);
			Log::Message($logtext, null, 101);
		}
		return $success;
	} // fn create
开发者ID:nistormihai,项目名称:Newscoop,代码行数:26,代码来源:Language.php

示例15: create

	/**
	 * Create an issue.
	 * @param string $p_shortName
	 * @param array $p_values
	 * @return boolean
	 */
	public function create($p_shortName, $p_values = null)
	{
	    $tmpValues = array('ShortName' => $p_shortName);
	    if (!is_null($p_values)) {
	       $tmpValues = array_merge($p_values, $tmpValues);
	    }
	    $success = parent::create($tmpValues);
	    if ($success) {
			if (function_exists("camp_load_translation_strings")) {
				camp_load_translation_strings("api");
			}
	    	$logtext = getGS('Issue "$1" ($2) added in publication $3',
				 $this->m_data['Name'], $this->m_data['Number'],
				 $this->m_data['IdPublication']);
    		Log::Message($logtext, null, 11);
	    }
	    return $success;
	} // fn create
开发者ID:nistormihai,项目名称:Newscoop,代码行数:24,代码来源:Issue.php


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