Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Setcontent refactor #303

Closed
wants to merge 13 commits into from

Conversation

@stryxx
Copy link
Collaborator

commented Feb 1, 2019

No description provided.

Rafał Wyciślik
@bobdenotter

This comment has been minimized.

Copy link
Member

commented Feb 1, 2019

@xiaohutai Could you also take a look at this? :-)

See also #194

@stryxx stryxx changed the title A concept of... [WIP] A concept of... Feb 1, 2019

src/Twig/Node/SetcontentNode.php Outdated Show resolved Hide resolved
src/Storage/Query/Query.php Outdated Show resolved Hide resolved

@JarJak JarJak changed the title [WIP] A concept of... [WIP] Setcontent refactor Feb 14, 2019

Rafał Wyciślik added some commits Feb 25, 2019

@stryxx stryxx changed the base branch from master to feature/related-content Feb 26, 2019

src/Entity/Content.php Outdated Show resolved Hide resolved
src/Repository/ContentRepository.php Outdated Show resolved Hide resolved
@JarJak

This comment has been minimized.

Copy link
Member

commented Feb 27, 2019

@stryxx rebase to master

@stryxx stryxx changed the base branch from feature/related-content to master Feb 28, 2019

@JarJak

This comment has been minimized.

Copy link
Member

commented Mar 1, 2019

Checklist copied from #116. API won't be 100% the same, but functionality should be kept.

Basic

  • {contenttype}
  • {contenttype}/first/{number}
  • {contenttype}/last/{number}
  • {contenttype}/random/{number}
  • random is not going to work with Doctrine ORM queries, see answer on Stack Oveflow for info.
    • ⚠️ An alternative is to make a special Twig function/filter to handle random records.
  • {contenttype}/{id}
  • {contenttype}/{slug}

WHERE

  • {key}: {value}
  • {key}: {operator}{value} where operator is one of % < > <= >=
    • ⚠️ Currently the operations will not work for numbers/dates/etc. because of JSON-encoded values.
  • author: {id} replaces ownerid from Bolt 3

WHERE advanced

  • {key}: {value1} || {value2} or {key}: {value1} && {value2}
  • "{key1} ||| {key2}": "{value1} ||| {value2}"
  • {key}: '>now' and other special datetime selectors (e.g. now, today, yesterday, last year, next thursday).

Special

  • limit {number}
  • orderby {field} or orderby -{field}
    • ⚠️ This works for fields that have only a single value (think of it as a column)
    • Multiple sortorders (comma-separated)
  • returnsingle
  • printquery
    • ⚠️ Currently shows DQL. Let's see if we can show a runnable query instead.

Advanced

Pagination and Search are not implemented yet.

  • allowpaging
  • {contenttype}/search/{num} where filter: {term}
  • {ct1},{ct2},{ctN}/search/{num} where filter: {term}

Misc

  • Implementations for locales, taxonomies and relationships.
  • Proper integration with Config + ContentType data (such as max results per page).

@JarJak JarJak requested review from xiaohutai and bobdenotter Mar 1, 2019

@stryxx stryxx changed the title [WIP] Setcontent refactor Setcontent refactor Mar 1, 2019

@@ -61,11 +61,19 @@ class Field implements Translatable
public $name;
/**
* @ORM\Column(type="json")
* @ORM\Column(type="string", length=4294967295)

This comment has been minimized.

Copy link
@JarJak

JarJak Mar 1, 2019

Member

type=text or json_array

* @Groups({"put"})
* @Gedmo\Translatable
*
* @var string

This comment has been minimized.

Copy link
@JarJak

JarJak Mar 1, 2019

Member

let's store it in model as array

}
}
$expressions[] = call_user_func_array([$expr, 'orX'], $orExpressions);

This comment has been minimized.

Copy link
@JarJak

JarJak Mar 1, 2019

Member

closures

private function getFieldOperation(string $fieldName): array
{
$exploded = explode('_', $fieldName);

This comment has been minimized.

Copy link
@JarJak

JarJak Mar 1, 2019

Member

can we use SPACE as separator here?

"@*@": "@*@"
}
"""

Scenario: As a user I fetch contents in JSON+LD format

This comment has been minimized.

Copy link
@JarJak

JarJak Mar 1, 2019

Member

Why jsonld has been deleted?

Rafał Wyciślik added some commits Mar 27, 2019

@stryxx stryxx changed the title Setcontent refactor [WIP] Setcontent refactor Mar 27, 2019

@bobdenotter

This comment has been minimized.

Copy link
Member

commented Apr 3, 2019

@stryxx Gentle nudge.. Any progress on this PR? :-)

@stryxx stryxx closed this Jun 24, 2019

@stryxx stryxx deleted the stryxx:refactor/setcontent-for-front branch Jun 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.