mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
fomratting
This commit is contained in:
@@ -78,7 +78,7 @@ class Base extends Types
|
||||
|
||||
$collection = $collections[$collection];
|
||||
|
||||
$this->collection = new Document;
|
||||
$this->collection = new Document();
|
||||
$this->collection->setAttribute('$id', $collection['$id']);
|
||||
|
||||
foreach ($collection['attributes'] as $attribute) {
|
||||
@@ -90,7 +90,7 @@ class Base extends Types
|
||||
|
||||
$this->collection->setAttribute('attributes', $attr, Document::SET_TYPE_APPEND);
|
||||
|
||||
if (in_array($attribute['$id'], $allowedAttributes)){
|
||||
if (in_array($attribute['$id'], $allowedAttributes)) {
|
||||
/**
|
||||
* todo find a way to Filter only allowed attribute, while selecting is ok
|
||||
*/
|
||||
@@ -129,7 +129,7 @@ class Base extends Types
|
||||
$this->types[] = Query::TYPE_SELECT;
|
||||
}
|
||||
|
||||
$context = new QueryContext;
|
||||
$context = new QueryContext();
|
||||
$context->add($this->collection);
|
||||
|
||||
parent::__construct($this->types, $context);
|
||||
|
||||
@@ -70,7 +70,7 @@ class V17 extends Filter
|
||||
/** @var Query|Query[] $queries */
|
||||
$queries = $this->parseQuery($query);
|
||||
|
||||
if ($queries instanceof Query){
|
||||
if ($queries instanceof Query) {
|
||||
$queries = [$queries];
|
||||
}
|
||||
|
||||
|
||||
@@ -702,13 +702,6 @@ class Response extends SwooleResponse
|
||||
*/
|
||||
public function dynamic(Document $document, string $model): void
|
||||
{
|
||||
|
||||
// if($model === 'attributeEnum'){
|
||||
// var_dump('in 1');
|
||||
// var_dump($model);
|
||||
// var_dump($document);
|
||||
// var_dump($this->getContentType());
|
||||
// }
|
||||
$output = $this->output(clone $document, $model);
|
||||
$output = $this->applyFilters($output, $model);
|
||||
|
||||
@@ -754,7 +747,7 @@ class Response extends SwooleResponse
|
||||
*/
|
||||
public function output(Document $document, string $model): array
|
||||
{
|
||||
$print= $model === 'attributeEnum';
|
||||
$print = $model === 'attributeEnum';
|
||||
|
||||
$data = clone $document;
|
||||
$model = $this->getModel($model);
|
||||
@@ -769,7 +762,7 @@ class Response extends SwooleResponse
|
||||
}
|
||||
|
||||
foreach ($model->getRules() as $key => $rule) {
|
||||
if($print && $key==='elements'){
|
||||
if ($print && $key === 'elements') {
|
||||
var_dump('Output 1 ===++++ ');
|
||||
var_dump($key);
|
||||
var_dump($rule);
|
||||
@@ -790,7 +783,7 @@ class Response extends SwooleResponse
|
||||
continue;
|
||||
}
|
||||
|
||||
if($print && $key==='elements'){
|
||||
if ($print && $key === 'elements') {
|
||||
var_dump('Output 1 ===++++ ');
|
||||
var_dump($key);
|
||||
var_dump($rule);
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace Appwrite\Utopia\Response\Model;
|
||||
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Database\Document;
|
||||
|
||||
class AttributeEnum extends Attribute
|
||||
{
|
||||
@@ -71,21 +70,4 @@ class AttributeEnum extends Attribute
|
||||
{
|
||||
return Response::MODEL_ATTRIBUTE_ENUM;
|
||||
}
|
||||
//
|
||||
// /**
|
||||
// * Process Document before returning it to the client
|
||||
// *
|
||||
// * @return Document
|
||||
// */
|
||||
// public function filter(Document $document): Document
|
||||
// {
|
||||
//
|
||||
// $formatOptions = $document->getAttribute('formatOptions');
|
||||
//
|
||||
// if (!\is_null($formatOptions)) {
|
||||
// $document->setAttribute('elements', $formatOptions['elements']);
|
||||
// }
|
||||
//
|
||||
// return $document;
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user