本文整理汇总了PHP中Field::getFormatDate方法的典型用法代码示例。如果您正苦于以下问题:PHP Field::getFormatDate方法的具体用法?PHP Field::getFormatDate怎么用?PHP Field::getFormatDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Field
的用法示例。
在下文中一共展示了Field::getFormatDate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFieldsArray
/**
* transforms the fields to a array for update
* @return array of fields
*/
public function getFieldsArray()
{
$new_fields = array();
foreach ($this->fields as $key => $value) {
$new_fields[$key] = $value;
if (is_string($value)) {
$t = strtotime($value);
if ($t != false) {
$new_fields[$key] = Field::getFormatDate($t);
}
}
}
return $new_fields;
}
示例2: hookActionProductCancel
/**
* execute when an item is deleted from an order
* @param mixed $params
*/
public function hookActionProductCancel($params)
{
if ($params == null) {
return;
}
$event_settings = $this->getEventSettings();
$target = null;
if (isset($event_settings['actionProductCancel']) && isset($event_settings['actionProductCancel']['champs'])) {
$target = new Target();
$target->values = array();
if ($this->checkInEventSettings($event_settings, 'actionProductCancel', 'modifDate')) {
$target->values[$event_settings['actionProductCancel']['champs']['modifDate']] = Field::getFormatDate(time());
}
}
if ($this->context->customer->isLogged()) {
$this->eventHookSegmentChange($this->context->customer, 'actionProductCancel', $target);
}
}
示例3: updateSegment
/**
* update a Segment
*
* @param Segment $segment
* @return Segment
*/
public function updateSegment(Segment $segment)
{
// convert the object to the array that will transform into json
$content = array('type' => $segment->type, 'id' => $segment->id, 'name' => $segment->name, 'description' => $segment->description, 'creation' => Field::getFormatDate(strtotime($segment->creation_date)), 'expiration' => Field::getFormatDate(strtotime($segment->expiration_date)), 'isTest' => $segment->for_test);
list($this->last_result, $this->last_error) = $this->rest_client->put($this->path . '/' . $segment->id, $content);
$this->erreur = $this->getError($this->last_result, $this->last_error);
if (isset($this->erreur)) {
return null;
}
if (!Segment::isJsonValid($this->last_result)) {
$this->erreur = $this->jsonErrorMessage();
return null;
}
return new Segment($this->last_result);
}