本文整理汇总了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));
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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
示例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
示例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
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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
示例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