Skip to content

[WIP] Feature/item persister and retriever - #1112

Open
discordier wants to merge 7 commits into
masterfrom
feature/item-persister-and-retriever
Open

[WIP] Feature/item persister and retriever#1112
discordier wants to merge 7 commits into
masterfrom
feature/item-persister-and-retriever

Conversation

@discordier

Copy link
Copy Markdown
Member

Description

This feature extracts the database interfacing routines into separate classes.

This is currently work in progress.

Checklist

  • Read and understood the CONTRIBUTING guidelines
  • Created tests, if possible
  • All tests passing
  • Extended the README / documentation, if necessary
  • Added myself to the @authors in touched PHP files
  • Checked the changes with phpcq and introduced no new issues

@discordier

Copy link
Copy Markdown
MemberAuthor

we might want to cherry-pick 2798cd6 here.

@zonky2zonky2 added the enhancement This issue is about an enhancement (aka new feature) label Apr 19, 2017
@zonky2zonky2 added this to the 2.0.0 milestone Apr 19, 2017
@zonky2

zonky2 commented Apr 19, 2017

Copy link
Copy Markdown
Contributor

@zonky2

zonky2 commented Apr 19, 2017

Copy link
Copy Markdown
Contributor

test for #1005 with translated_text: the empty "zomby cells" live on

@discordier in my opinion, we should implement the check to empty values at

publicfunctionsetTranslatedDataFor($arrValues, $strLangCode)
{
$objDB = $this->getMetaModel()->getServiceContainer()->getDatabase();
// First off determine those to be updated and those to be inserted.
$arrIds = array_keys($arrValues);
$arrExisting = array_keys($this->getTranslatedDataFor($arrIds, $strLangCode));
$arrNewIds = array_diff($arrIds, $arrExisting);
// Update existing values.
$strQuery = 'UPDATE ' . $this->getValueTable() . ' %s';
foreach ($arrExistingas$intId) {
$arrWhere = $this->getWhere($intId, $strLangCode);
$objDB->prepare($strQuery . ($arrWhere ? ' WHERE ' . $arrWhere['procedure'] : ''))
->set($this->getSetValues($arrValues[$intId], $intId, $strLangCode))
->execute(($arrWhere ? $arrWhere['params'] : null));
}
// Insert the new values.
$strQuery = 'INSERT INTO ' . $this->getValueTable() . ' %s';
foreach ($arrNewIdsas$intId) {
$objDB->prepare($strQuery)
->set($this->getSetValues($arrValues[$intId], $intId, $strLangCode))
->execute();
}
}

we can use two strategies:

@zonky2zonky2 added the Up for discussion This ticket will be up for discussion in one of our next calls label Apr 23, 2017
@zonky2

Copy link
Copy Markdown
Contributor

=> "check the value and delete"

@zonky2zonky2 removed the Up for discussion This ticket will be up for discussion in one of our next calls label Apr 24, 2017
@stefanheimes
stefanheimes changed the base branch from hotfix/alpha-15 to hotfix/alpha-16May 22, 2017 22:11
@stefanheimes
stefanheimes changed the base branch from hotfix/alpha-16 to hotfix/2.0.0-alpha16May 22, 2017 22:46
@discordier
discordierforce-pushed the feature/item-persister-and-retriever branch from f21ba95 to def1cc7CompareMay 30, 2017 20:43
@richardhj

Copy link
Copy Markdown
Member

Change base branch and reopen?

@discordier
discordier changed the base branch from hotfix/2.0.0-alpha16 to hotfix/2.0.0-alpha17September 18, 2017 11:27
@discordierdiscordier reopened this Sep 18, 2017
@discordier

Copy link
Copy Markdown
MemberAuthor

Something else to do here, we should inject the persister, retriever and resolver via constructor injection.
That way the MetaModel will become more independent and we could swap either component by another one (using doctrine connection i.e.) in the future.

@zonky2

Copy link
Copy Markdown
Contributor

Why closed?

@discordier
discordier changed the base branch from hotfix/2.0.0-alpha17 to hotfix/2.0.0-alpha18February 7, 2018 10:23
@discordierdiscordier reopened this Feb 7, 2018
@discordier

Copy link
Copy Markdown
MemberAuthor

I deleted the alpha17 branch and github closed the PR then. :/

@zonky2

Copy link
Copy Markdown
Contributor

o.k.

@discordier
discordierforce-pushed the feature/item-persister-and-retriever branch from def1cc7 to cf3a346CompareMarch 6, 2018 12:25
@zonky2zonky2 removed this from the 2.0.0 milestone Mar 9, 2018
@zonky2zonky2 added this to the 2.1.0 milestone Mar 9, 2018
@discordier
discordier changed the base branch from hotfix/2.0.0-alpha18 to masterMarch 10, 2018 00:22
@discordierdiscordier reopened this Mar 10, 2018
@discordier
discordierforce-pushed the feature/item-persister-and-retriever branch from cf3a346 to 8e06889CompareMarch 10, 2018 00:30
In addition we also now have an IdResolver
We also have hybrid attributes (like select) which are both, ISimple and
IComplex. We might also have all other kinds of combinations.
Therefore we now have the sequence of:
- Always fetch simple attributes
- Then try translated
- Finally try complex
@discordier
discordierforce-pushed the feature/item-persister-and-retriever branch from 8e06889 to d329d9dCompareMarch 10, 2018 00:40
@zonky2zonky2 modified the milestones: 2.1.0, 2.2.0Mar 14, 2018
@zonky2zonky2 modified the milestones: 2.2.0, 2.3.0May 11, 2022
@zonky2zonky2 modified the milestones: 2.3.0, 2.4.0Nov 1, 2023
@zonky2zonky2 modified the milestones: 2.4.0, FutureAug 1, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancementThis issue is about an enhancement (aka new feature)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@discordier@zonky2@richardhj@stefanheimes@dmolineus