當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Tinebase_DateTime::getTimestamp方法代碼示例

本文整理匯總了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());
 }
開發者ID:rodrigofns,項目名稱:ExpressoLivre3,代碼行數:8,代碼來源:DateTimeTest.php

示例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();
     }
 }
開發者ID:ingoratsdorf,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:15,代碼來源:Samba.php

示例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);
 }
開發者ID:hernot,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:28,代碼來源:Ldap.php

示例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()})");
     }
 }
開發者ID:ingoratsdorf,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:15,代碼來源:Egw14.php

示例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);
 }
開發者ID:ingoratsdorf,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:32,代碼來源:ActiveDirectory.php

示例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);
 }
開發者ID:,項目名稱:,代碼行數:12,代碼來源:

示例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;
 }
開發者ID:,項目名稱:,代碼行數:34,代碼來源:


注:本文中的Tinebase_DateTime::getTimestamp方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。