Skip to content

refactor timestampable traits of entities into trait #105

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

Merged
merged 24 commits into from
Feb 6, 2023

Conversation

johguentner
Copy link
Member

  • move properties created_time, last_updated_time, etc. to its own trait
  • remove attributes and methods from entity classes (which are applied by traid)
  • apply traid to according entity classes (database, page and block)
  • add created_by, last_updated_by to this new trait

johguentner and others added 2 commits February 4, 2023 18:21
- move properties created_time, last_updated_time, etc. to its own trait
- remove attributes and methods from entity classes (which are applied by traid)
- apply traid to according entity classes (database, page and block)
- add created_by, last_updated_by to this new trait
@johguentner johguentner requested a review from mechelon February 4, 2023 17:22
@what-the-diff
Copy link

what-the-diff bot commented Feb 4, 2023

  • Add TimestampableEntity trait to Block, Database and Page entities
  • Use the new trait in fillFromRaw() method of each entity
  • Remove createdTime, lastEditedTime properties from each entity as they are now handled by the Trait
  • Remove fillCreatedTime(), fillLastEditedTime() methods from Entity class (they were only used by those 3 classes)
  • Update getters for created_time and last_edited_time on all three entities to use their respective property instead of calling parent::getResponseData(). This is because we want these values returned as Carbon instances rather than strings so that it's easier for users to work with them without having to convert themselves every time they need a timestamp value or do date comparisons etc...

johguentner and others added 17 commits February 5, 2023 10:43
- refactor rawTitle into richTitle
- add description and rawDescription (with according fill and getter)
- within the database entity
- add description example to stub
- to ``HasTimestamps``
- for improved readability
- move page logic of ``HasParent`` to its on trait and did minor refactoring
- add ``HasParent`` to Database and Block entity
- tests already exist for page entity
- add to database and block tests
- add raw parent property to stubs within block and database
- add missing prop to stub
- add check for property within database test
- the handling of archived-flags can be added to entities by this trait
- add trait to database, page and block
- to database, block and pages
- change stubs regarding the archived-flag, to force testing to check for ``true`` as archived
- and do filling of ``id`` and ``object`` within a entity base class method
- call ``::fillEntityBase`` form the ``fillFromRaw`` within all according entitites
- add test-cases for checking ``getObjectType``
@johguentner johguentner modified the milestones: 🍵 v1.1.0, 🌳 v1.0.0 Feb 5, 2023
@johguentner johguentner merged commit 34acb4c into dev Feb 6, 2023
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.

2 participants