本文整理汇总了PHP中Tinebase_DateTime::getTimestamp方法的典型用法代码示例。如果您正苦于以下问题:PHP Tinebase_DateTime::getTimestamp方法的具体用法?PHP Tinebase_DateTime::getTimestamp怎么用?PHP Tinebase_DateTime::getTimestamp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tinebase_DateTime
的用法示例。
在下文中一共展示了Tinebase_DateTime::getTimestamp方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testConstructFromIsoString
public function testConstructFromIsoString()
{
$dt = new Tinebase_DateTime('2010-06-25 18:04:00');
$this->assertEquals('1277489040', $dt->getTimestamp());
// after 32 Bit timestamp overflow (2038-01-19 03:14:07)
$dt = new Tinebase_DateTime('2040-06-25 18:04:00');
$this->assertEquals('2224260240', $dt->getTimestamp());
}
示例2: inspectExpiryDate
/**
* inspect set expiry date
*
* @param Tinebase_DateTime $_expiryDate the expirydate
* @param array $_ldapData the data to be written to ldap
*/
public function inspectExpiryDate($_expiryDate, array &$_ldapData)
{
if ($_expiryDate instanceof Tinebase_DateTime) {
// seconds since Jan 1, 1970
$_ldapData['sambakickofftime'] = $_expiryDate->getTimestamp();
} else {
$_ldapData['sambakickofftime'] = array();
}
}
示例3: setExpiryDateInSyncBackend
/**
* sets/unsets expiry date in ldap backend
*
* expiryDate is the number of days since Jan 1, 1970
*
* @param mixed $_accountId
* @param Tinebase_DateTime $_expiryDate
*/
public function setExpiryDateInSyncBackend($_accountId, $_expiryDate)
{
if ($this->_isReadOnlyBackend) {
return;
}
$metaData = $this->_getMetaData($_accountId);
if ($_expiryDate instanceof DateTime) {
// days since Jan 1, 1970
$ldapData = array('shadowexpire' => floor($_expiryDate->getTimestamp() / 86400));
} else {
$ldapData = array('shadowexpire' => array());
}
foreach ($this->_ldapPlugins as $plugin) {
$plugin->inspectExpiryDate($_expiryDate, $ldapData);
}
if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) {
Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . " {$metaData['dn']} ldapData: " . print_r($ldapData, true));
}
$this->_ldap->update($metaData['dn'], $ldapData);
}
示例4: _appendRecordFilter
/**
* appends filter to egw14 select obj. for raw event retirval
*
* @param Zend_Db_Select $_select
* @return void
*/
protected function _appendRecordFilter($_select)
{
$_select->where($this->_egwDb->quoteInto($this->_egwDb->quoteIdentifier('cal_reference') . ' = ?', 0));
parent::_appendRecordFilter($_select);
if ($this->_config->importStartDate) {
$importStartDate = new Tinebase_DateTime($this->_config->importStartDate);
$_select->where($this->_egwDb->quoteIdentifier('records.cal_id') . " IN (SELECT DISTINCT(cal_id) FROM egw_cal_dates WHERE cal_end > {$importStartDate->getTimestamp()})");
}
}
示例5: setExpiryDateInSyncBackend
/**
* sets/unsets expiry date in ldap backend
*
* @param mixed $_accountId
* @param Tinebase_DateTime $_expiryDate
*/
public function setExpiryDateInSyncBackend($_accountId, $_expiryDate)
{
if ($this->_isReadOnlyBackend) {
return;
}
$metaData = $this->_getMetaData($_accountId);
if ($_expiryDate instanceof DateTime) {
$ldapData['accountexpires'] = bcmul(bcadd($_expiryDate->getTimestamp(), '11644473600'), '10000000');
if ($this->_options['useRfc2307']) {
// days since Jan 1, 1970
$ldapData = array_merge($ldapData, array('shadowexpire' => floor($_expiryDate->getTimestamp() / 86400)));
}
} else {
$ldapData = array('accountexpires' => '9223372036854775807');
if ($this->_options['useRfc2307']) {
$ldapData = array_merge($ldapData, array('shadowexpire' => array()));
}
}
foreach ($this->_ldapPlugins as $plugin) {
$plugin->inspectExpiryDate($_expiryDate, $ldapData);
}
if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) {
Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . " {$metaData['dn']} {$ldapData}: " . print_r($ldapData, true));
}
$this->_ldap->update($metaData['dn'], $ldapData);
}
示例6: setExpiryDate
/**
* sets/unsets expiry date (calls backend class with the same name)
*
* @param int $_accountId
* @param Tinebase_DateTime $_expiryDate
*/
public function setExpiryDate($_accountId, $_expiryDate)
{
$metaData = $this->_getMetaData($_accountId);
$data = array('shadowexpire' => $_expiryDate->getTimestamp());
$this->_backend->update($metaData['dn'], $data);
}
示例7: setStatus
/**
* set the status of the user
*
* @param mixed $_accountId
* @param string $_status
* @return unknown
*/
public function setStatus($_accountId, $_status)
{
if ($this instanceof Tinebase_User_Interface_SyncAble) {
$this->setStatusInSyncBackend($_accountId, $_status);
}
$accountId = Tinebase_Model_User::convertUserIdToInt($_accountId);
switch ($_status) {
case 'enabled':
$accountData[$this->rowNameMapping['loginFailures']] = 0;
$accountData[$this->rowNameMapping['accountExpires']] = null;
$accountData['status'] = $_status;
break;
case 'disabled':
$accountData['status'] = $_status;
break;
case 'expired':
$accountData['expires_at'] = Tinebase_DateTime::getTimestamp();
break;
default:
throw new Tinebase_Exception_InvalidArgument('$_status can be only enabled, disabled or expired');
break;
}
$accountsTable = new Tinebase_Db_Table(array('name' => SQL_TABLE_PREFIX . 'accounts'));
$where = array($this->_db->quoteInto($this->_db->quoteIdentifier('id') . ' = ?', $accountId));
$result = $accountsTable->update($accountData, $where);
return $result;
}