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
Closed

Conversation

@stryxx
Copy link
Collaborator

@stryxx stryxx commented Feb 1, 2019

No description provided.

@bobdenotter
Copy link
Member

@bobdenotter bobdenotter commented Feb 1, 2019

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

See also #194

Loading

@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
Loading
src/Storage/Query/Query.php Outdated Show resolved Hide resolved
Loading
Loading
@JarJak JarJak changed the title [WIP] A concept of... [WIP] Setcontent refactor Feb 14, 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
Loading
src/Repository/ContentRepository.php Outdated Show resolved Hide resolved
Loading
Loading
@JarJak
Copy link
Member

@JarJak JarJak commented Feb 27, 2019

@stryxx rebase to master

Loading

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

@JarJak JarJak 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).

Loading

@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)
Copy link
Member

@JarJak JarJak Mar 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type=text or json_array

Loading

Copy link
Member

@JarJak JarJak Mar 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loading

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

@JarJak JarJak Mar 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's store it in model as array

Loading

}
}

$expressions[] = call_user_func_array([$expr, 'orX'], $orExpressions);
Copy link
Member

@JarJak JarJak Mar 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

closures

Loading


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

@JarJak JarJak Mar 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use SPACE as separator here?

Loading

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

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

@JarJak JarJak Mar 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why jsonld has been deleted?

Loading

@bobdenotter bobdenotter removed this from the Bolt 4 alpha 3 milestone Mar 20, 2019
@bobdenotter bobdenotter added this to the Bolt 4 beta 1 milestone Mar 20, 2019
@stryxx stryxx changed the title Setcontent refactor [WIP] Setcontent refactor Mar 27, 2019
@bobdenotter
Copy link
Member

@bobdenotter bobdenotter commented Apr 3, 2019

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

Loading

@bobdenotter bobdenotter removed this from the Bolt 4 beta 1 milestone Apr 10, 2019
@bobdenotter bobdenotter added this to the Bolt 4 beta 2 milestone Apr 10, 2019
@stryxx stryxx closed this Jun 24, 2019
@stryxx stryxx deleted the 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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants