本文整理汇总了PHP中Tinebase_Helper::arrayHash方法的典型用法代码示例。如果您正苦于以下问题:PHP Tinebase_Helper::arrayHash方法的具体用法?PHP Tinebase_Helper::arrayHash怎么用?PHP Tinebase_Helper::arrayHash使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tinebase_Helper
的用法示例。
在下文中一共展示了Tinebase_Helper::arrayHash方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testArrayHash
public function testArrayHash()
{
$hash = Tinebase_Helper::arrayHash(array('foo' => 'bar'));
$this->assertEquals('37b51d194a7513e45b56f6524f2d51f2', $hash);
$hash = Tinebase_Helper::arrayHash(array('foo' => 'bar'), true);
$this->assertEquals('3858f62230ac3c915f300c664312c63f', $hash);
}
示例2: getApplicationsHash
/**
* get hash of installed applications
*
* @param string $_sort optional the column name to sort by
* @param string $_dir optional the sort direction can be ASC or DESC only
* @param string $_filter optional search parameter
* @param int $_limit optional how many applications to return
* @param int $_start optional offset for applications
* @return string
*/
public function getApplicationsHash($_filter = NULL, $_sort = null, $_dir = 'ASC', $_start = NULL, $_limit = NULL)
{
$applications = $this->getApplications($_filter, $_sort, $_dir, $_start, $_limit);
// create a hash of installed applications and their versions
$applications = array_combine(Tinebase_Application::getInstance()->getApplications()->id, Tinebase_Application::getInstance()->getApplications()->version);
ksort($applications);
return Tinebase_Helper::arrayHash($applications, true);
}
示例3: get
/**
* get by id
*
* @param string $_id
* @param int $_containerId
* @return Expressomail_Model_Account
*/
public function get($_id, $_containerId = NULL)
{
Tinebase_Core::setupCache();
$cache = Tinebase_Core::getCache();
$cacheId = Tinebase_Helper::arrayHash(array(Tinebase_Core::getUser()->accountId, $_id));
$record = $cache->load($cacheId);
if ($record === FALSE) {
$record = parent::get($_id, $_containerId);
if ($record->user_id !== Tinebase_Core::getUser()->accountId) {
$record = new Expressomail_Model_Account();
}
if ($record->type == Expressomail_Model_Account::TYPE_SYSTEM) {
$this->_addSystemAccountConfigValues($record);
}
$cache->save($record, $cacheId, array('expressomailAccount'));
}
return $record;
}