本文整理汇总了PHP中Zend_Log::DEBUG方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Log::DEBUG方法的具体用法?PHP Zend_Log::DEBUG怎么用?PHP Zend_Log::DEBUG使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Log
的用法示例。
在下文中一共展示了Zend_Log::DEBUG方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTag
/**
* converts category to tag
*
* @param int $catId
* @return string tagid
*/
public function getTag($catId)
{
if (!(isset($this->_tagMapCache[$catId]) || array_key_exists($catId, $this->_tagMapCache))) {
$select = $this->_egwDb->select()->from(array('cats' => 'egw_categories'))->where($this->_egwDb->quoteInto($this->_egwDb->quoteIdentifier('cat_id') . ' = ?', $catId));
$cat = $this->_egwDb->fetchAll($select, NULL, Zend_Db::FETCH_ASSOC);
$cat = count($cat) === 1 ? $cat[0] : NULL;
if (!$cat) {
$this->_log->DEBUG(__METHOD__ . '::' . __LINE__ . " category {$catId} not found in egw, skipping tag");
return $this->_tagMapCache[$catId] = NULL;
}
$tineDb = Tinebase_Core::getDb();
$select = $tineDb->select()->from(array('tags' => $tineDb->table_prefix . 'tags'))->where($tineDb->quoteInto($tineDb->quoteIdentifier('name') . ' LIKE ?', $cat['cat_name']));
$tag = $tineDb->fetchAll($select, NULL, Zend_Db::FETCH_ASSOC);
$tag = count($tag) > 0 ? $tag[0] : NULL;
if ($tag) {
return $this->_tagMapCache[$catId] = $tag['id'];
}
// create tag
$catData = unserialize($cat['cat_data']);
$tagId = Tinebase_Record_Abstract::generateUID();
$tagType = $cat['cat_access'] == 'public' ? Tinebase_Model_Tag::TYPE_SHARED : Tinebase_Model_Tag::TYPE_PERSONAL;
$tagOwner = $tagType == Tinebase_Model_Tag::TYPE_SHARED ? 0 : $this->mapAccountIdEgw2Tine($cat['cat_owner']);
$this->_log->NOTICE(__METHOD__ . '::' . __LINE__ . " creating new {$tagType} tag '{$cat['cat_name']}'");
$tineDb->insert($tineDb->table_prefix . 'tags', array('id' => $tagId, 'type' => $tagType, 'owner' => $tagOwner, 'name' => $cat['cat_name'], 'description' => $cat['cat_description'], 'color' => $catData['color'], 'created_by' => $tagOwner ? $tagOwner : Tinebase_Core::getUser()->getId(), 'creation_time' => $cat['last_mod'] ? $this->convertDate($cat['last_mod']) : Tinebase_DateTime::now()));
$right = new Tinebase_Model_TagRight(array('tag_id' => $tagId, 'account_type' => $tagType == Tinebase_Model_Tag::TYPE_SHARED ? Tinebase_Acl_Rights::ACCOUNT_TYPE_ANYONE : Tinebase_Acl_Rights::ACCOUNT_TYPE_USER, 'account_id' => $tagOwner, 'view_right' => true, 'use_right' => true));
Tinebase_Tags::getInstance()->setRights($right);
Tinebase_Tags::getInstance()->setContexts(array(0), $tagId);
$this->_tagMapCache[$catId] = $tagId;
}
return $this->_tagMapCache[$catId];
}