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

Adding function "createNew" to simplify the creation of a ezsitedata entry #33

Merged
merged 3 commits into from
Jan 11, 2017

Conversation

pkamps
Copy link
Member

@pkamps pkamps commented Jan 6, 2017

Most changes are due to code reformatting. I added a new function "createNew" to simplify the creation process.
The function has a new unit test.

@peterkeung
Copy link
Member

peterkeung commented Jan 6, 2017

@pkamps
Copy link
Member Author

pkamps commented Jan 6, 2017

Ha, it's so good to have people reviewing your code.

  1. yes, just yes
  2. No, it's wasting my time - I don't mind if somebody else submits it.
  3. I looked at other persistentobject classes like ezpolicy.php or ezrole.php: they also call 'store()' inside the class in case of the function 'createNew'. But a lot more kernel classes implement the 'create' function. So I think I'll drop 'createNew' and implement a 'create' function. Or do you think we should keep the createNew function?

@peterkeung
Copy link
Member

  1. We will discuss more internally. There is a big picture here, which is that the eZ subscription clients are using eZ's repo.
  2. I like a "create" function without "store()". In keeping with the convention with normal eZ content objects, we then add "store()" in a separate API layer. It's a bit silly in my opinion, but it's at least consistent with what we use most often.

@pkamps
Copy link
Member Author

pkamps commented Jan 7, 2017

Point 1) and 3) addressed.

@ernestob
Copy link
Member

I have tested this, it works great and it is very flexible. This seems to be a good replacement for objects created in the CMS with a focus on storing data that is not going to be directly edited by the users.

Creating a value and creating a new value with the same key(name) will overwrite any existing value.

Copy link
Member

@peterkeung peterkeung left a comment

Choose a reason for hiding this comment

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

+1 other than these doc fixes

@@ -8,38 +8,64 @@
* @package kernel
*/

/**
* eZPersistentObject implementation for ezsite_data table.
* Allows to store and fetch key/value pairs
Copy link
Member

Choose a reason for hiding this comment

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

"Allows" should be "Enables you"

);
}

/**
* Cronstructs a new eZSiteData instance. You need to call 'store()'
Copy link
Member

Choose a reason for hiding this comment

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

"Constructs" not "Cronstructs"

@pkamps
Copy link
Member Author

pkamps commented Jan 11, 2017

Typos fixed. Please confirm.

@peterkeung
Copy link
Member

Good to squash and merge.

@pkamps
Copy link
Member Author

pkamps commented Jan 11, 2017

ezp pull request:
ezsystems#1273

@pkamps pkamps merged commit b222c1f into master Jan 11, 2017
@pkamps pkamps deleted the extend-ezsite-data branch January 11, 2017 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants