本文整理汇总了PHP中WindowsAzure\Common\Internal\Utilities::isoDate方法的典型用法代码示例。如果您正苦于以下问题:PHP Utilities::isoDate方法的具体用法?PHP Utilities::isoDate怎么用?PHP Utilities::isoDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WindowsAzure\Common\Internal\Utilities
的用法示例。
在下文中一共展示了Utilities::isoDate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: serialize
/**
* Serializes the current state.
*
* @param CurrentState $state The current state.
* @param IOutputStream $outputStream The output stream.
*
* @return none
*/
public function serialize($state, $outputStream)
{
$statusLeaseInfo = array('StatusLease' => array('@attributes' => array('ClientId' => $state->getClientId())));
if ($state instanceof AcquireCurrentState) {
$statusLeaseInfo['StatusLease']['Acquire'] = array('Incarnation' => $state->getIncarnation(), 'Status' => $state->getStatus(), 'Expiration' => Utilities::isoDate(date_timestamp_get($state->getExpiration())));
} elseif ($state instanceof ReleaseCurrentState) {
$statusLeaseInfo['StatusLease']['Release'] = array();
}
$currentState = Utilities::serialize($statusLeaseInfo, 'CurrentState');
fwrite($outputStream, $currentState);
}
示例2: testGetEntity
/**
* @covers WindowsAzure\Table\Internal\AtomReaderWriter::getEntity
* @covers WindowsAzure\Table\Internal\AtomReaderWriter::__construct
* @covers WindowsAzure\Table\Internal\AtomReaderWriter::_serializeAtom
* @covers WindowsAzure\Table\Internal\AtomReaderWriter::_generateProperties
*/
public function testGetEntity()
{
// Setup
$atomSerializer = new AtomReaderWriter();
$entity = TestResources::getTestEntity('123', '456');
$expected = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' . "\n" . '<entry xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">' . "\n" . ' <title/>' . "\n" . ' <updated>' . Utilities::isoDate() . '</updated>' . "\n" . ' <author>' . "\n" . ' <name/>' . "\n" . ' </author>' . "\n" . ' <id/>' . "\n" . ' <content type="application/xml">' . "\n" . ' <m:properties>' . "\n" . ' <d:PartitionKey>123</d:PartitionKey>' . "\n" . ' <d:RowKey>456</d:RowKey>' . "\n" . ' <d:CustomerId m:type="Edm.Int32">890</d:CustomerId>' . "\n" . ' <d:CustomerName>John</d:CustomerName>' . "\n" . ' <d:IsNew m:type="Edm.Boolean">1</d:IsNew>' . "\n" . ' <d:JoinDate m:type="Edm.DateTime">2012-01-26T18:26:19Z</d:JoinDate>' . "\n" . ' </m:properties>' . "\n" . ' </content>' . "\n" . '</entry>' . "\n";
// Test
$actual = $atomSerializer->getEntity($entity);
// Assert
$this->assertEquals($expected, $actual);
return $actual;
}
示例3: testIsoDate
/**
* @covers WindowsAzure\Common\Internal\Utilities::isoDate
*/
public function testIsoDate()
{
// Test
$date = Utilities::isoDate();
// Assert
$this->assertNotNull($date);
}
示例4: testSetTimestamp
/**
* @covers WindowsAzure\Table\Models\Entity::setTimestamp
* @covers WindowsAzure\Table\Models\Entity::getTimestamp
*/
public function testSetTimestamp()
{
// Setup
$entity = new Entity();
$expected = Utilities::convertToDateTime(Utilities::isoDate());
// Test
$entity->setTimestamp($expected);
// Assert
$this->assertEquals($expected, $entity->getTimestamp());
}
示例5: _serializeAtom
/**
* Serializes the atom into XML representation.
*
* @param array $properties The atom properties.
*
* @return string
*/
private function _serializeAtom($properties)
{
$xmlw = new \XmlWriter();
$xmlw->openMemory();
$xmlw->setIndent(true);
$xmlw->startDocument(strtoupper($this->_xmlVersion), $this->_xmlEncoding, 'yes');
$xmlw->startElementNS(null, 'entry', $this->_atomNamespaceName);
$xmlw->writeAttribute("xmlns:{$this->_dataServicesPrefix}", $this->_dataServicesNamespaceName);
$xmlw->writeAttribute("xmlns:{$this->_dataServicesMetadataPrefix}", $this->_dataServicesMetadataNamespaceName);
$xmlw->writeElement('title');
$xmlw->writeElement('updated', Utilities::isoDate());
$xmlw->startElement('author');
$xmlw->writeElement('name');
$xmlw->endElement();
$xmlw->writeElement('id');
$xmlw->startElement('content');
$xmlw->writeAttribute('type', Resources::XML_CONTENT_TYPE);
$xmlw->startElementNS($this->_dataServicesMetadataPrefix, 'properties', null);
$this->_generateProperties($xmlw, $properties);
$xmlw->endElement();
$xmlw->endElement();
$xmlw->endElement();
return $xmlw->outputMemory(true);
}