data-transfer-object
Doctrine
data-transfer-object | Doctrine | |
---|---|---|
16 | 13 | |
2,177 | 9,825 | |
- | 0.1% | |
6.4 | 9.8 | |
over 1 year ago | 8 days ago | |
PHP | PHP | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
data-transfer-object
- Data-Mapper: A package for fast mapping of strong-typed objects
- brick/json-mapper: map JSON data to strongly typed PHP DTOs
-
A (very) small package to cast a variable to a new type, in including custom classes
Speaking of… https://github.com/spatie/data-transfer-object is dead, does doctrine offer similar functionality?
-
Given a messy class used _heavily_ with a hard time understanding whats going on... how to log stuff in testing / demo??
Once you are confident in the argument types, add them to the methods. If there are too many, create a Data Transfer Object. Also add method return types.
-
Refactoring #5: From arrays to Data Transfer Objects
The benefits of using DTOs are numerous, there's even a package from Spatie for them. See the package's release post and this awesome DTO explanation for a more in-depth take and how to implement and use them in a more sensible way.
-
Leveraging DTOs for JSON database columns as an alternative to additional tables
I opted to use Spatie's DTO package and a bit of additional custom code for easy casting. I decided to map each JSON column to its own DTO, so I created two classes for land and for army.
-
What are peoples thoughts/feelings regarding PHP attributes?
When possible, I surely will try using the spatie/data-transfer-object with attributes to see if I like it.
-
Workflow to keep CHANGELOG up-to-date with Release Notes
Open Source projects using this Action. Mostly my own projects, as I just released the Action. However, Spatie, a huge contributor to open source PHP packages recently added the workflow to their PHP package template; which makes me super proud ♥️
-
Restricting ORM objects to repository classes and DTOs
This spatie lib looks neat too, though it might not be all that static analysis friendly. I guess this doesn't save you from having two classes with the same properties. Seems like it could be worth a shot. Short of inventing a code generation tool I don't know how much better I can do.
- Autoload callback when certain class is called first time
Doctrine
-
Bisecting vendors
If you compare 2.17.x with 2.16.x, you can see quite a few contributions, over a long period of time, and by many different people. Some of them are part of the Doctrine core team, some others are returning contributors, and a few made their very first contribution to that repository. They all do that on their spare time, sometimes after a long day of paid work, take vacations, have a family to take care of. The core team is subscribed to issues, but it's unlikely that contributors are.
-
postgres and doctrine - don't know where to put this default preference.
(ClassMetadataFactory.php:766 called by ClassMetadataFactory.php:625, https://github.com/doctrine/orm/issues/8893, package doctrine/orm)
-
Feedback on sfCon 2022
Next, I went to see Nicolas Grekas' talk about proxies: he presented different ways to implement a proxy system, and examples of each one that can be found in Symfony or Doctrine. Doctrine has an old implementation in doctrine/common that we are trying to get rid off, and Nicolas has proposed to replace those with Lazy Ghost proxies. I know, I know, funny name. 👻 Lazy ghost proxies cannot be used with final classes, or internal classes, but do allow to use a fluent API, which makes them a good fit for doctrine/orm entities.
-
Moving from Annotations to Attributes with Doctrine ORM
Also, since 2.13.0, you get validation at runtime. But it depends on the context I'd say. For instance, for the test suite of doctrine/orm, the best solution is Attributes IMO. When you're doing DDD, XML sounds great!
- Doctrine preUpdate event not triggered for empty association field.
-
Doctrine & Closed Manager : Showerthoughts
Solution 3 would be awesome but is far away. A closer term solution 4 could be to make the manager resettable.
-
PHP 8.1.0 has been tagged today!
It's tracked in this issue: https://github.com/doctrine/orm/issues/9021
-
Teaser: A php parser and company backend in emacs lisp
You're right, that one doesn't have type hints or phpdoc, I'm not quite sure why.. this one, which is installed in my vendor folder in the demo, does have phpdoc :)
-
Hoping for some experienced insight
Doctrine
- Anyone using Doctrine2 ORM mapping type: php?
What are some alternatives?
php-dto - A data transfer object inspired by Rust's serde
Eloquent - [READ ONLY] Subtree split of the Illuminate Database component (see laravel/framework)
Serializer - Library for (de-)serializing data of any complexity (supports JSON, and XML)
RedBean - ORM layer that creates models, config and database on the fly
package-skeleton-laravel - A skeleton repository for Spatie's Laravel Packages
Medoo - The lightweight PHP database framework to accelerate the development.
git-auto-commit-action - Automatically commit and push changed files back to GitHub with this GitHub Action for the 80% use case.
Propel - Propel2 is an open-source high-performance Object-Relational Mapping (ORM) for modern PHP
fram - Fram is a view framework for PHP
Atlas.Orm - A data mapper implementation for your persistence model in PHP.
serializer - Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.
Pomm - PHP Object Model Manager for Postgresql