Comments (5)
That’s because of the IdentityMapper
. It keeps a cache of all the instances fetched from the database to ensure that if a record is fetched twice it will return the same instance hence an update on the instance will update it everywhere.
The model manager is an entity CRUD oriented model. What you are trying to do in PHP would by far be better done in SQL using the SimpleQueryManager
:
WITH
deleted_foo AS (DELETE FROM foo WHERE {condition} RETURNING foo_id)
SELECT
count(foo.foo_id) AS existing_count,
count(deleted_foo.foo_id) AS deleted_count
FROM foo, deleted_foo
from modelmanager.
Well that was not an good example :)
What to remove was to be decided after the record was fetched and looking at the disk if the file exists.
from modelmanager.
I think maybe you should use a ConvertedResultIterator
for this, you do not really need OO entities for this.
from modelmanager.
This means that I have to mix arrays and entities which is not nice. Having the ability to clear those entities would be nice.
Also using pomm in running long running processes e.g queue processors would benefit from this.
from modelmanager.
This is the job of another model manager, it will pop in in 3.0
from modelmanager.
Related Issues (20)
- Method to truncate table
- Make the use of prepared statement configurable
- WriteQueries :: UpdateByWhere HOT 12
- Get model class from entity HOT 6
- Disable Prefixing with session name and/or schema HOT 3
- Switching schema on the fly HOT 1
- Object hydration problem when the binding is null
- StatefulEntityTrait::status() method is confusing HOT 16
- FlexibleEntityInterface::fields() and FlexibleEntityInterface::extract() are somehow a bit redundant HOT 1
- Error docs HOT 2
- PgEntity convert null value into empty string HOT 7
- Choose not to return the projection of the query HOT 2
- Model and interfaces
- When `FlexibleEntity::extract` is overloaded, the `Model::insertOne` method fails
- Model & entity generator to read what to generate from a file HOT 2
- Possibly missing information in Quick Pomm2 setup HOT 3
- Null value casted in string HOT 3
- Collection Filters HOT 1
- Possibly missing information in Quick Pomm2 setup HOT 2
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 modelmanager.