Пример #1
0
 /**
  * Deleting Objects
  * https://parse.com/docs/rest/guide#objects-deleting-objects
  *
  * @param $className
  * @param $objectId
  * @return mixed
  */
 public function delete($className, $objectId)
 {
     $this->prepareClassMetadata($className);
     $object = ParseHelper::makeModelObject($className);
     $find = $object->find($objectId);
     if (count($find) == 0) {
         return array("code" => 101, "error" => "object not found for delete");
     }
     $find->delete();
     return \Response::json(new \stdClass());
 }
Пример #2
0
 /**
  * @param $className
  */
 protected function prepareClassMetadata($className)
 {
     $this->object = ParseHelper::makeModelObject($className);
     $this->columns = ParseHelper::getModelColumns($this->object);
     $this->relations = ParseHelper::getModelRelations($this->object);
 }