Comments (8)
Is Identity a Value Object ? How is it configured in your Entity Map ?
from analogue.
IdentityMap.php:
use Analogue\ORM\ValueMap;
class IdentityMap extends ValueMap
{
protected $attributes = ['first_name', 'last_name'];
}
UserMap.php:
use Analogue\ORM\EntityMap;
class UserMap extends EntityMap {
protected $table = 'users';
protected $embeddables = ['identity' => Identity::class];
}
Identity.php:
use Analogue\ORM\ValueObject;
class Identity extends ValueObject {
public function __construct($firstName, $lastName)
{
$this->first_name = $firstName;
$this->last_name = $lastName;
}
}
User.php
use Analogue\ORM\Entity;
class User extends Entity {
public function __construct(Identity $identity)
{
$this->identity = $identity;
}
}
from analogue.
Are your column correctly named identity_first_name and identity_last_name in the database ?
from analogue.
Yes, it works like it should in the first test... values are inserted... do u not get the error?
from analogue.
No, I tried to replicate exactly what you did, i don't get any error. Must be something else. Are your IdentityMap and UserMap classes in the same namespace as the corresponding entity. I suspect one of them is not registered / detected correctly.
from analogue.
i pushed my example here https://github.com/mitjarobic/analogue-example
Its a fresh Laravel 5 installation
All classes are in the App namespace. Code should produce the error.
from analogue.
Thanks! I'll have a look.
from analogue.
did u get the error?
from analogue.
Related Issues (20)
- What is the best way to 'detach' a relation? (in my case, belongsToMany) HOT 2
- What's the best way to count a relation without loading the Entities? HOT 7
- Translations base on analogue Orm HOT 3
- Unable to save foreign keys in 5.5 HOT 3
- Undefined variable: factory HOT 1
- The update $dirtyRelatedAggregates override foreighn keys to null HOT 7
- Documentation Request HOT 3
- The problem with storing entity with embedding object HOT 3
- CollectionProxy does not implement some Collection methods correctly HOT 2
- 5.5 entities with generated proxies are unable to serialize due to a closure HOT 2
- (Feature Request) Composite Keys HOT 1
- Problem hydrating relations HOT 3
- Is it possible to have properties of entity in camelCase, but fields in DB are in snake_case? HOT 3
- SoftDeletes not working HOT 2
- Automatically eager load not working HOT 1
- Incomplete BelongsToMany eager loads HOT 5
- Eloquent 5.7 HOT 3
- Analogue Slim Framework/Silex HOT 3
- Can we map columns to class properties? HOT 4
- Can't install Analogue on Laravel 6 HOT 16
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 analogue.