Skip to content

Commit

Permalink
- normalizing default relation nullability for BelongsTo, ManyToMany
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfy-j committed Sep 5, 2019
1 parent 3d7c12e commit 40dcfb5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Relation/BelongsTo.php
Expand Up @@ -33,7 +33,7 @@ final class BelongsTo extends RelationSchema implements InversableInterface
Relation::LOAD => Relation::LOAD_PROMISE,

// nullable by default
Relation::NULLABLE => true,
Relation::NULLABLE => false,

// link to parent entity primary key by default
Relation::INNER_KEY => '{relation}_{outerKey}',
Expand Down
6 changes: 3 additions & 3 deletions src/Relation/HasMany.php
Expand Up @@ -32,12 +32,12 @@ final class HasMany extends RelationSchema implements InversableInterface
// do not pre-load relation by default
Relation::LOAD => Relation::LOAD_PROMISE,

// custom where condition
Relation::WHERE => [],

// not nullable by default
Relation::NULLABLE => false,

// custom where condition
Relation::WHERE => [],

// link to parent entity primary key by default
Relation::INNER_KEY => '{source:primaryKey}',

Expand Down
2 changes: 1 addition & 1 deletion src/Relation/ManyToMany.php
Expand Up @@ -33,7 +33,7 @@ final class ManyToMany extends RelationSchema implements InversableInterface
Relation::LOAD => Relation::LOAD_PROMISE,

// nullable by default
Relation::NULLABLE => true,
Relation::NULLABLE => false,

// custom where condition
Relation::WHERE => [],
Expand Down

0 comments on commit 40dcfb5

Please sign in to comment.