本文整理汇总了PHP中DatabaseObject::setProperty方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseObject::setProperty方法的具体用法?PHP DatabaseObject::setProperty怎么用?PHP DatabaseObject::setProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DatabaseObject
的用法示例。
在下文中一共展示了DatabaseObject::setProperty方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setProperty
/**
* Wrapper around DatabaseObject::setProperty
* @see classes/DatabaseObject#setProperty($p_dbColumnName, $p_value, $p_commit, $p_isSql)
*/
public function setProperty($p_dbColumnName, $p_value, $p_commit = true, $p_isSql = false)
{
if ($p_dbColumnName == 'Name') {
$this->m_keyColumnNames = array('Name');
$this->resetCache();
$this->m_keyColumnNames = array('Id');
}
return parent::setProperty($p_dbColumnName, $p_value);
}
示例2: setProperty
/**
* Wrapper around DatabaseObject::setProperty
*
* @see classes/DatabaseObject#setProperty($p_dbColumnName, $p_value, $p_commit, $p_isSql)
*/
public function setProperty($p_dbColumnName, $p_value, $p_commit = true, $p_isSql = false)
{
if ($p_dbColumnName == 'Number') {
$this->m_keyColumnNames = array('NrArticle', 'Number');
$this->resetCache();
$this->m_keyColumnNames = array('NrArticle', 'IdImage');
}
return parent::setProperty($p_dbColumnName, $p_value);
} // fn setProperty
示例3: setProperty
function setProperty($p_name, $p_value)
{
$result = parent::setProperty($p_name, $p_value);
if ($p_name == 'status' || $p_name == 'admin_status') {
BlogEntry::TriggerCounters($this->getProperty('fk_entry_id'));
}
$CampCache = CampCache::singleton();
$CampCache->clear('user');
return $result;
}
示例4: setUrlName
/**
* @param string value
*/
public function setUrlName($p_value)
{
$this->m_cacheUpdate = true;
return parent::setProperty('ShortName', $p_value);
} // fn setUrlName
示例5: setProperty
/**
* Method to call parent::setProperty
* with clening the cache.
*
* @param string $p_name
* @param sring $p_value
*/
function setProperty($p_name, $p_value)
{
$return = parent::setProperty($p_name, $p_value);
$CampCache = CampCache::singleton();
$CampCache->clear('user');
return $return;
}
示例6: setUrlName
/**
* @param string value
*/
public function setUrlName($p_value)
{
return parent::setProperty('ShortName', $p_value);
}
示例7: setProperty
public function setProperty($p_dbColumnName, $p_value, $p_commit = true, $p_isSql = false)
{
if (!in_array($p_dbColumnName, $this->m_columnNames)) {
return false;
}
$articleField = new ArticleTypeField($this->m_articleTypeName, substr($p_dbColumnName, 1));
if ($articleField->getType() == ArticleTypeField::TYPE_BODY) {
// Replace <span class="subhead"> ... </span> with <!** Title> ... <!** EndTitle>
$text = preg_replace_callback("/(<\s*span[^>]*class\s*=\s*[\"']campsite_subhead[\"'][^>]*>|<\s*span|<\s*\/\s*span\s*>)/i",
array('ArticleData', "TransformSubheads"), $p_value);
// Replace <a href="campsite_internal_link?IdPublication=1&..." ...> ... </a>
// with <!** Link Internal IdPublication=1&...> ... <!** EndLink>
$text = preg_replace_callback("/(<\s*a\s*(((href\s*=\s*[\"'](\\/campsite\\/)?campsite_internal_link[?][\w&=;]*[\"'])|(\w+\s*=\s*['\"][_\w]*['\"]))+[\s]*)*[\s\w\"']*>)|(<\s*\/a\s*>)/i",
array('ArticleData', "TransformInternalLinks"), $text);
// Replace <img id=".." src=".." alt=".." title=".." align="..">
// with <!** Image [image_template_id] align=".." alt=".." sub="..">
$idAttr = "(id\s*=\s*\"[^\"]*\")";
$srcAttr = "(src\s*=\s*\"[^\"]*\")";
$altAttr = "(alt\s*=\s*\"[^\"]*\")";
$subAttr = "(title\s*=\s*\"[^\"]*\")";
$alignAttr = "(align\s*=\s*\"[^\"]*\")";
$widthAttr = "(width\s*=\s*\"[^\"]*\")";
$heightAttr = "(height\s*=\s*\"[^\"]*\")";
$otherAttr = "(\w+\s*=\s*\"[^\"]*\")*";
$pattern = "/<\s*img\s*(($idAttr|$srcAttr|$altAttr|$subAttr|$alignAttr|$widthAttr|$heightAttr|$otherAttr)\s*)*\/>/i";
$p_value = preg_replace_callback($pattern, array($this, "transformImageTags"), $text);
}
if ($articleField->getType() == ArticleTypeField::TYPE_SWITCH) {
return parent::setProperty($p_dbColumnName, (int)($p_value == 'on'), $p_commit);
}
return parent::setProperty($p_dbColumnName, $p_value, $p_commit, $p_isSql);
}
示例8: setProperty
public function setProperty($p_name, $p_value)
{
switch ($p_name) {
case 'question':
case 'answer':
if ($this->getProperty($p_name) == '') {
parent::setProperty($p_name.'_date', date('Y-m-d H:i:s'));
}
break;
}
$return = parent::setProperty($p_name, $p_value);
$CampCache = CampCache::singleton();
$CampCache->clear('user');
return $return;
}
示例9: setProperty
/**
* Set the given column name to the given value.
* The object's internal variable will also be updated.
* If the value hasn't changed, the database will not be updated.
*
* Note: Returns false when setting the fields node_left and node_right.
* We don't want to allow direct update of these fields.
*
* Note: You cannot set $p_commit to FALSE and $p_isSql to TRUE
* at the same time.
*
* @param string $p_dbColumnName
* The name of the column that is to be updated.
*
* @param string $p_value
* The value to set.
*
* @param boolean $p_commit
* If set to true, the value will be written to the database immediately.
* If set to false, the value will not be written to the database.
* Default is true.
*
* @param boolean $p_isSql
* Set this to TRUE if p_value consists of SQL commands.
* There is no way to know what the result of the command is,
* so we will need to refetch the value from the database in
* order to update the internal variable's value.
*
* @return boolean
* TRUE on success, FALSE on error.
*/
public function setProperty($p_dbColumnName, $p_value, $p_commit = true, $p_isSql = false)
{
if ($p_dbColumnName == 'node_left' || $p_dbColumnName == 'node_right') {
return false;
}
return parent::setProperty($p_dbColumnName, $p_value, $p_commit, $p_isSql);
}
示例10: setProperty
function setProperty($p_name, $p_value)
{
if ($p_name == 'topics') {
$return = $this->setTopics($p_value);
$CampCache = CampCache::singleton();
$CampCache->clear('user');
return $return;
}
/*
if ($p_name == 'admin_status') {
switch ($p_value) {
case 'online':
case 'moderated':
case 'readonly':
parent::setProperty('date', date('Y-m-d H:i:s'));
break;
case 'offline':
case 'pending':
parent::setProperty('date', null);
break;
}
}
*/
$result = parent::setProperty($p_name, $p_value);
if ($p_name == 'status' || $p_name == 'admin_status') {
require_once 'Blog.php';
Blog::TriggerCounters($this->getProperty('fk_blog_id'));
}
$CampCache = CampCache::singleton();
$CampCache->clear('user');
return $result;
}
示例11: setAuthorId
/**
* @param int $p_value
* @return boolean
*/
public function setAuthorId($p_value, $p_commit = true)
{
return parent::setProperty('fk_author_id', $p_value, $p_commit);
} // fn setAuthorId
示例12: setProperty
public function setProperty($p_dbColumnName, $p_value, $p_commit = true, $p_isSql = false)
{
if (!in_array($p_dbColumnName, $this->m_columnNames)) {
return false;
}
$articleField = new ArticleTypeField($this->m_articleTypeName, substr($p_dbColumnName, 1));
if ($articleField->getType() == ArticleTypeField::TYPE_BODY) {
// Replace <span class="subhead"> ... </span> with <!** Title> ... <!** EndTitle>
$text = preg_replace_callback("/(<\\s*span[^>]*class\\s*=\\s*[\"']campsite_subhead[\"'][^>]*>|<\\s*span|<\\s*\\/\\s*span\\s*>)/i", array('ArticleData', "TransformSubheads"), $p_value);
// Replace <a href="campsite_internal_link?IdPublication=1&..." ...> ... </a>
// with <!** Link Internal IdPublication=1&...> ... <!** EndLink>
$text = preg_replace_callback("/(<\\s*a\\s*(((href\\s*=\\s*[\"'](\\/campsite\\/)?campsite_internal_link[?][\\w&=;]*[\"'])|(\\w+\\s*=\\s*['\"][_\\w]*['\"]))+[\\s]*)*[\\s\\w\"']*>)|(<\\s*\\/a\\s*>)/i", array('ArticleData', "TransformInternalLinks"), $text);
// Replace <img id=".." src=".." alt=".." title=".." align="..">
// with <!** Image [image_template_id] align=".." alt=".." sub="..">
$idAttr = "(id\\s*=\\s*\"[^\"]*\")";
$srcAttr = "(src\\s*=\\s*\"[^\"]*\")";
$altAttr = "(alt\\s*=\\s*\"[^\"]*\")";
$subAttr = "(title\\s*=\\s*\"[^\"]*\")";
$alignAttr = "(align\\s*=\\s*\"[^\"]*\")";
$widthAttr = "(width\\s*=\\s*\"[^\"]*\")";
$heightAttr = "(height\\s*=\\s*\"[^\"]*\")";
$otherAttr = "(\\w+\\s*=\\s*\"[^\"]*\")*";
$pattern = "/<\\s*img\\s*{$idAttr}\\s*(({$srcAttr}|{$altAttr}|{$subAttr}|{$alignAttr}|{$widthAttr}|{$heightAttr}|{$otherAttr})\\s*)*\\/>/i";
$p_value = preg_replace_callback($pattern, array($this, "transformImageTags"), $text);
// Replace snippets div holder with snippets tag
// Replace <div data-snippet-id="$1" class="camp_snippet">Snippet $1</div>
// with <-- Snippet 1 -->
$pattern = "/<div\\s*class=\"camp_snippet\"\\s*(?:data-snippet-id=\"([\\d*])\")>([\\w*]+)* ([\\d*]+)<\\/div>/i";
$p_value = preg_replace($pattern, "<-- Snippet \$1 -->", $p_value);
}
if ($articleField->getType() == ArticleTypeField::TYPE_SWITCH) {
if (is_string($p_value)) {
return parent::setProperty($p_dbColumnName, (int) ($p_value == 'on'), $p_commit);
} elseif (is_int($p_value)) {
return parent::setProperty($p_dbColumnName, $p_value, $p_commit);
}
}
return parent::setProperty($p_dbColumnName, $p_value, $p_commit, $p_isSql);
}
示例13: setProperty
/**
* If we modify the admin status,
* the publish date is modified too.
*
* @param string $p_name
* @param sring $p_value
*/
function setProperty($p_name, $p_value)
{
/*
if ($p_name == 'admin_status') {
switch ($p_value) {
case 'online':
case 'moderated':
case 'readonly':
parent::setProperty('date', date('Y-m-d H:i:s'));
break;
case 'offline':
case 'pending':
parent::setProperty('date', null);
break;
}
}
*/
if ($p_name == 'topics') {
$return = $this->setTopics($p_value);
$CampCache = CampCache::singleton();
$CampCache->clear('user');
return $return;
}
if ($p_name == 'fk_language_id') {
$this->onSetLanguage($p_value);
}
$return = parent::setProperty($p_name, $p_value);
$CampCache = CampCache::singleton();
$CampCache->clear('user');
return $return;
}