当前位置: 首页>>代码示例>>PHP>>正文


PHP ParseObject::getCreatedAt方法代码示例

本文整理汇总了PHP中Parse\ParseObject::getCreatedAt方法的典型用法代码示例。如果您正苦于以下问题:PHP ParseObject::getCreatedAt方法的具体用法?PHP ParseObject::getCreatedAt怎么用?PHP ParseObject::getCreatedAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Parse\ParseObject的用法示例。


在下文中一共展示了ParseObject::getCreatedAt方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: price

 public function price($data)
 {
     $cp = new ParseQuery("CarWashPackages");
     $results = $cp->get($data["objectId"]);
     $results->set("isRemoved", true);
     $results->save();
     $newPackage = new ParseObject("CarWashPackages");
     $newPackage->set("detail", $data["detail"]);
     $newPackage->set("isRemoved", false);
     $newPackage->set("title", $data["title"]);
     $newPackage->set("priceNum", (double) $data["priceNum"]);
     $newPackage->set("price", "\$" . $data["priceNum"]);
     $newPackage->set("estTime", (int) $data["estTime"]);
     try {
         $newPackage->save();
         $response = array("Status" => "SUCCESS", "objectId" => $newPackage->getObjectId(), "title" => $newPackage->get("title"), "detail" => $newPackage->get("detail"), "priceNum" => $newPackage->get("priceNum"), "estTime" => $newPackage->get("estTime"), "createdAt" => $newPackage->getCreatedAt());
         return $response;
     } catch (ParseException $ex) {
         $ex_array = array("Status" => "FAILED", "Message" => $ex->getMessage(), "Code" => $ex->getCode());
         return $ex_array;
     }
 }
开发者ID:oscarsmartwave,项目名称:l45fbl45t,代码行数:22,代码来源:Packages_model.php

示例2: mergeFromObject

 /**
  * Merge data from other object.
  *
  * @param ParseObject $other
  */
 private function mergeFromObject($other)
 {
     if (!$other) {
         return;
     }
     $this->objectId = $other->getObjectId();
     $this->createdAt = $other->getCreatedAt();
     $this->updatedAt = $other->getUpdatedAt();
     $this->serverData = $other->serverData;
     $this->operationSet = [];
     $this->hasBeenFetched = true;
     $this->rebuildEstimatedData();
 }
开发者ID:bohemima,项目名称:parse-php-sdk,代码行数:18,代码来源:ParseObject.php

示例3: getABeacon

function getABeacon(ParseObject $object)
{
    $beacon = new stdClass();
    $beacon->objectId = $object->getObjectId();
    $beacon->uuid = $object->get('UUID');
    $beacon->beaconColor = $object->get('beaconColor');
    if (count($object->getRelation("brand")->getQuery()->find()) != 0) {
        $beaconBrand = $object->getRelation("brand")->getQuery()->find();
        $beacon->brand = getABrand($beaconBrand[0]);
    } else {
        $beacon->brand = null;
    }
    $beacon->major = $object->get('major');
    $beacon->minor = $object->get('minor');
    $beacon->name = $object->get('name');
    if ($object->get('region') != null) {
        $beaconRegion = $object->get('region')->fetch();
        $beacon->region = getARegion($beaconRegion);
    } else {
        $beacon->region = null;
    }
    $beacon->type = $object->get('type');
    $beacon->createdAt = $object->getCreatedAt();
    $beacon->upadtedAt = $object->getUpdatedAt();
    return $beacon;
}
开发者ID:azimjs,项目名称:chartswell-admin,代码行数:26,代码来源:global.php

示例4: parseObjectToArray

 /**
  * @return array
  */
 public function parseObjectToArray(ParseObject $object)
 {
     $array = $object->getAllKeys();
     $array['objectId'] = $object->getObjectId();
     $createdAt = $object->getCreatedAt();
     if ($createdAt) {
         $array['createdAt'] = $this->dateToString($createdAt);
     }
     $updatedAt = $object->getUpdatedAt();
     if ($updatedAt) {
         $array['updatedAt'] = $this->dateToString($updatedAt);
     }
     if ($object->getACL()) {
         $array['ACL'] = $object->getACL()->_encode();
     }
     foreach ($array as $key => $value) {
         if ($value instanceof ParseObject) {
             if ($value->getClassName() == $this->parseObject->getClassName() && $value->getObjectId() == $this->parseObject->getObjectId()) {
                 // If a key points to this parent object, we will skip it to avoid
                 // infinite recursion.
             } elseif ($value->isDataAvailable()) {
                 $array[$key] = $this->parseObjectToArray($value);
             }
         } elseif ($value instanceof ParseFile) {
             $array[$key] = $value->_encode();
         }
     }
     return $array;
 }
开发者ID:parziphal,项目名称:parse,代码行数:32,代码来源:ObjectModel.php


注:本文中的Parse\ParseObject::getCreatedAt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。