Skip to content

Commit

Permalink
unify "behavior" spelling in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Nov 23, 2024
1 parent ede9fa8 commit afd31ee
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ if needed (see Field::actual)

### Basic Properties

Fields have properties, which define its behaviour. Some properties apply on how
Fields have properties, which define its behavior. Some properties apply on how
the values are handled or restrictions on interaction, other values can even
help with data visualization. For example if {php:attr}`Field::$enum` is used
with Agile UI form, it will be displayed as radio button or a drop-down:
Expand Down
14 changes: 7 additions & 7 deletions docs/joins.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,38 +170,38 @@ of master id.

When it comes to deleting record, there are three possible conditions:

1. `[delete_behaviour = cascade, reverse = false]`
1. `[deleteBehavior = cascade, reverse = false]`

If we are using strong join and master table contains ID of foreign table,
then foreign master table record is deleted first. Foreign table record is
deleted after. This is done to avoid error with foreign constraints.

2. `[deleteBehaviour = cascade, reverse = true]`
2. `[deleteBehavior = cascade, reverse = true]`

If we are using strong join and foreign table contains ID of master table,
then foreign table record is deleted first followed by the master table record.

3. `[deleteBehaviour = ignore, reverse = false]`
3. `[deleteBehavior = ignore, reverse = false]`

If we are using weak join and the master table contains ID of foreign table,
then master table is deleted first. Foreign table record is not deleted.

4. `[deleteBehaviour = setnull, reverse = true]`
4. `[deleteBehavior = setnull, reverse = true]`

If we are using weak join and foreign table contains ID of master table,
then foreign table is updated to set ID of master table to NULL first.
Then the master table record is deleted.

Based on the way how you define join an appropriate strategy is selected and
Join will automatically decide on $deleteBehaviour and $reverse values.
Join will automatically decide on $deleteBehavior and $reverse values.
There are situations, however when it's impossible to determine in which order
the operations have to be performed. A good example is when you define both
master/foreign fields.

In this case system will default to "reverse=false" and will delete master
record first, however you can specify a different value for "reverse".

Sometimes it's also sensible to set deleteBehaviour = ignore and perform your
Sometimes it's also sensible to set deleteBehavior = ignore and perform your
own delete operation yourself.

### Implementation Detail
Expand All @@ -214,7 +214,7 @@ Joins are implemented like this:
When save is executed, it will execute additional query to update foreign table.
- while $model->getId() stores the ID of the main table active record, $join->id
stores ID of the foreign record and will be used when updating.
- option 'deleteBehaviour' is 'cascade' for strong joins and 'ignore' for weak
- option 'deleteBehavior' is 'cascade' for strong joins and 'ignore' for weak
joins, but you can set some other value. If you use "setnull" value and you
are using reverse join, then foreign table record will not be updated, but
value of the foreign field will be set to null.
Expand Down
2 changes: 1 addition & 1 deletion docs/model.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ Read more about {php:class}`Model\UserAction`

### Hooks

Hooks (behaviours) can allow you to define callbacks which would trigger
Hooks (behaviors) can allow you to define callbacks which would trigger
when data is loaded, saved, deleted etc. Hooks are typically defined in
{php:meth}`Model::init()` but will be executed accordingly.

Expand Down
2 changes: 1 addition & 1 deletion docs/references.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ change them (`$m->set('paid_amount', 123);`), you will receive exception.
### Available Aggregation Functions

The mathematical aggregate `sum` will automatically
default to 0 if no respective rows were provided. The default SQL behaviour is to
default to 0 if no respective rows were provided. The default SQL behavior is to
return NULL, but this does go well with the cascading formulas:

```
Expand Down
2 changes: 1 addition & 1 deletion src/Persistence/Sql/Oracle/PlatformTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function getTimeTypeDeclarationSQL(array $column)
}

// Oracle DBAL platform autoincrement implementation does not increment like
// Sqlite or MySQL does, unify the behaviour
// Sqlite or MySQL does, unify the behavior

#[\Override]
public function getCreateSequenceSQL(Sequence $sequence)
Expand Down
4 changes: 2 additions & 2 deletions src/Persistence/Sql/Postgresql/PlatformTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

trait PlatformTrait
{
// standard PostgreSQL character types are case sensitive, unify the behaviour with other databases
// standard PostgreSQL character types are case sensitive, unify the behavior with other databases
// with custom case insensitive types

/**
Expand Down Expand Up @@ -77,7 +77,7 @@ public function convertBooleansToDatabaseValue($item)
}

// PostgreSQL DBAL platform uses SERIAL column type for autoincrement which does not increment
// when a row with a not-null PK is inserted like Sqlite or MySQL does, unify the behaviour
// when a row with a not-null PK is inserted like Sqlite or MySQL does, unify the behavior

private function getPrimaryKeyColumn(Table $table): ?Column
{
Expand Down
2 changes: 1 addition & 1 deletion src/Persistence/Sql/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ public function join(
$j = [];

// try to find alias in foreign table definition
// TODO this behaviour should be deprecated
// TODO this behavior should be deprecated
if ($foreignAlias === null) {
[$foreignTable, $foreignAlias] = array_pad(explode(' ', $foreignTable, 2), 2, null);
}
Expand Down

0 comments on commit afd31ee

Please sign in to comment.