Comments (3)
It looks like a request for a new interface Cycle\ORM\QueryBuilderInterface
with methods select($role): Select
, update(...)
and delete(...)
The select()
method just returns the Cycle\ORM\Select
class.
update()
and delete()
methods must provide fields mappings and relation joins like in the Select class.
from orm.
Hello. Please share how you imagine the API. What would the end user code look like?
Btw, you might be interested in looking at a small example of how it's possible to implement ActiveRecord based on the Cycle
https://github.com/roxblnfk/cycle-active-record
from orm.
Something like
$orm->getRepository(User::class)->update([
'name' => 'foo'
])->where('name', '!=', 'bar')->run();
or since repositories are read only:
$manager = new \Cycle\ORM\EntityManager($orm);
$manager->update(User::class)
->set([
'name' => 'foo'
])
->where('name', '!=', 'bar')
->run()
;
But I'm not sure if this would be possible
from orm.
Related Issues (20)
- 🐛 Possible incorrect phpDoc in EntityProviderInterface HOT 2
- 🐛 Issue with Single Table Inheritance (STI) and Type Casting in Child Entities HOT 1
- Update badges HOT 1
- 🐛 PHP 8.3
- CTE support for QueryBuilder HOT 1
- 🐛 fkAction/fkOnDelete has no effect for automatically created migrations HOT 1
- 💡 Add options set for auto-generated column values
- Cascade Persist Fails without cloning object in softDelete Method
- 💡 Cycle schema hydration is too slow
- 🐛 HasOne. select by relation property generates unnecessary INNER JOIN HOT 3
- Expected parameter of type 'Cycle\Annotated\Locator\EmbeddingLocatorInterface', 'Spiral\Tokenizer\ClassLocator' provided HOT 2
- Check useless `order by` on some ORM prefetches
- Index Names Not Applied to Database When Using Annotations HOT 1
- 💡 Embeddable Behaviors
- 💡 Allow setting enum cases as property defaults
- 🐛 In changelog version 2.8 is missed
- 💡 Ability to use `with` more than once with same relation. For several JOINs HOT 1
- 🐛 Issue with Enum Field Difference Detected During Database Migration Synchronization
- 💡 Efficient bulk-loading of morph relations
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from orm.