Comments (4)
The first parameter in ->with() should be the name of the association as defined in the models.
Weither the association is plural or not depends on the association name.
If Cities has one Countries, then CityFactory::make()->with('Countries');
from cakephp-fixture-factories.
Under HasOne Associations there are examples where asociations are singular, like HomeAddress.
I think it is ok to leave the examples as such, mixed plural and singular.
from cakephp-fixture-factories.
Yeah, the Cake docs are bit confusing here.
Usually the relation is always plural still, so I thought this could be a bit confusing.
$this->belongsTo('Countries', [
'propertyName' => 'country'
]);
I opened a PR for discussion as this shouldnt be the case in default docs and conventions:
cakephp/docs#7776
from cakephp-fixture-factories.
The 5.x docs have been fixed up to be consistent: https://book.cakephp.org/5/en/orm/associations.html#hasone-associations
Feel free to close if you wanna keep things as they are.
from cakephp-fixture-factories.
Related Issues (20)
- Primary key of type text should generate UUID HOT 1
- What is the mergeAssociated(array $data) function for? HOT 1
- Testing simple method without persisting data HOT 1
- fakerphp 8.2 warnings HOT 1
- Creating multiple translations using shadowStrategy HOT 1
- Truncate Dirty Tables Slowness HOT 2
- Feature Request: Add back-reference property to sub-entities HOT 5
- Error: Column "id" is an identity column defined as GENERATED ALWAYS HOT 1
- Feature Request: Ability to set nested values using `make` method HOT 2
- Enhance array notation
- Calling `with()` inside `setDefaultTemplate()` occurs unexpected increase of the associated entities HOT 4
- phpdoc @param types of `FactoryAwareTrait::getFactory()` is too narrower than acceptable types HOT 1
- Factory::make ignores null values
- Factory::make ignores null values HOT 2
- Plans on doing a Cake5 release? HOT 2
- Factories use the wrong connection when called from a PHPUnit v10.x static data providers HOT 1
- Plugin class name HOT 1
- v3.1 get result set
- Some thoughts/improvements HOT 3
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 cakephp-fixture-factories.