Skip to content

Commit

Permalink
Fix typo: updateable => updatable
Browse files Browse the repository at this point in the history
  • Loading branch information
beberlei committed Dec 19, 2021
1 parent 07a2c0a commit 9674f31
Show file tree
Hide file tree
Showing 23 changed files with 94 additions and 94 deletions.
4 changes: 2 additions & 2 deletions docs/en/reference/annotations-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Optional attributes:
included when inserting a new row into the underlying entities table. Reloads the value after inserts or updates
if the value is false. If not specified, default value is true.

- **updateable**: Boolean value to determine if the column should be
- **updatable**: Boolean value to determine if the column should be
included when updating the row of the underlying entities table. Reloads the value after inserts or updates
if the value is false. If not specified, default value is true.

Expand Down Expand Up @@ -203,7 +203,7 @@ Examples:
/**
* Generated column
* @Column(type="string", name="user_fullname", insertable=false, updateable=false)
* @Column(type="string", name="user_fullname", insertable=false, updatable=false)
*/
protected $fullname;
Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/attributes-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Optional attributes:
Reloads the value after inserts or updates if the value is false.
If not specified, default value is ``true``.

- **updateable**: Boolean value to determine if the column should be
- **updatable**: Boolean value to determine if the column should be
included when updating the row of the underlying entities table.
Reloads the value after inserts or updates if the value is false.
If not specified, default value is ``true``.
Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/basic-mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ list:
column is nullable.
- ``insertable``: (optional, default TRUE) Whether the database
column should be inserted.
- ``updateable``: (optional, default TRUE) Whether the database
- ``updatable``: (optional, default TRUE) Whether the database
column should be updated.
- ``precision``: (optional, default 0) The precision for a decimal
(exact numeric) column (applies only for decimal column),
Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/xml-mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ Optional attributes:
- nullable - Should this field allow NULL as a value? Defaults to
false.
- insertable - Should this field be inserted? Defaults to true.
- updateable - Should this field be updated? Defaults to true.
- updatable - Should this field be updated? Defaults to true.
- version - Should this field be used for optimistic locking? Only
works on fields with type integer or datetime.
- scale - Scale of a decimal type.
Expand Down
2 changes: 1 addition & 1 deletion doctrine-mapping.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@
<xs:attribute name="unique" type="xs:boolean" default="false" />
<xs:attribute name="nullable" type="xs:boolean" default="false" />
<xs:attribute name="insertable" type="xs:boolean" default="true" />
<xs:attribute name="updateable" type="xs:boolean" default="true" />
<xs:attribute name="updatable" type="xs:boolean" default="true" />
<xs:attribute name="version" type="xs:boolean" />
<xs:attribute name="column-definition" type="xs:string" />
<xs:attribute name="precision" type="xs:integer" use="optional" />
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Cache/DefaultEntityHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function buildCacheEntry(ClassMetadata $metadata, EntityCacheKey $key, $e
}

foreach ($metadata->fieldMappings as $name => $fieldMapping) {
if (isset($fieldMapping['notInsertable']) || isset($fieldMapping['notUpdateable'])) {
if (isset($fieldMapping['notInsertable']) || isset($fieldMapping['notUpdatable'])) {
$data[$name] = $metadata->getFieldValue($entity, $name);
}
}
Expand Down
6 changes: 3 additions & 3 deletions lib/Doctrine/ORM/Mapping/Builder/FieldBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ public function insertable(bool $flag = true)
}

/**
* Sets updateable.
* Sets updatable.
*
* @return $this
*/
public function updateable(bool $flag = true)
public function updatable(bool $flag = true)
{
if (! $flag) {
$this->mapping['notUpdateable'] = true;
$this->mapping['notUpdatable'] = true;
}

return $this;
Expand Down
16 changes: 8 additions & 8 deletions lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
* id?: bool,
* nullable?: bool,
* notInsertable?: bool,
* notUpdateable?: bool,
* notUpdatable?: bool,
* columnDefinition?: string,
* precision?: int,
* scale?: int,
Expand Down Expand Up @@ -439,8 +439,8 @@ class ClassMetadataInfo implements ClassMetadata
* - <b>'notInsertable'</b> (boolean, optional)
* Whether the column is not insertable. Optional. Is only set if value is TRUE.
*
* - <b>'notUpdateable'</b> (boolean, optional)
* Whether the column is updateable. Optional. Is only set if value is TRUE.
* - <b>'notUpdatable'</b> (boolean, optional)
* Whether the column is updatable. Optional. Is only set if value is TRUE.
*
* - <b>columnDefinition</b> (string, optional, schema-only)
* The SQL fragment that is used when generating the DDL for the column.
Expand Down Expand Up @@ -1300,17 +1300,17 @@ public function isInsertable($fieldName)
}

/**
* Checks if the field is updateable.
* Checks if the field is updatable.
*
* @param string $fieldName The field name.
*
* @return bool TRUE if the field is updateable, FALSE otherwise.
* @return bool TRUE if the field is updatable, FALSE otherwise.
*/
public function isUpdateable($fieldName)
public function isUpdatable($fieldName)
{
$mapping = $this->getFieldMapping($fieldName);

return ! isset($mapping['notUpdateable']);
return ! isset($mapping['notUpdatable']);
}

/**
Expand Down Expand Up @@ -2688,7 +2688,7 @@ public function mapField(array $mapping)
$mapping = $this->validateAndCompleteFieldMapping($mapping);
$this->assertFieldNotMapped($mapping['fieldName']);

if (isset($mapping['notInsertable']) || isset($mapping['notUpdateable'])) {
if (isset($mapping['notInsertable']) || isset($mapping['notUpdatable'])) {
$this->requiresFetchAfterUpdate = true;
}

Expand Down
6 changes: 3 additions & 3 deletions lib/Doctrine/ORM/Mapping/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ final class Column implements Annotation
public $insertable = true;

/** @var bool */
public $updateable = true;
public $updatable = true;

/** @var array<string,mixed> */
public $options = [];
Expand All @@ -68,7 +68,7 @@ public function __construct(
bool $unique = false,
bool $nullable = false,
bool $insertable = true,
bool $updateable = true,
bool $updatable = true,
array $options = [],
?string $columnDefinition = null
) {
Expand All @@ -80,7 +80,7 @@ public function __construct(
$this->unique = $unique;
$this->nullable = $nullable;
$this->insertable = $insertable;
$this->updateable = $updateable;
$this->updatable = $updatable;
$this->options = $options;
$this->columnDefinition = $columnDefinition;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -743,8 +743,8 @@ private function columnToArray(string $fieldName, Mapping\Column $column): array
$mapping['notInsertable'] = true;
}

if (! $column->updateable) {
$mapping['notUpdateable'] = true;
if (! $column->updatable) {
$mapping['notUpdatable'] = true;
}

if ($column->options) {
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/ORM/Mapping/Driver/AttributeDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -583,8 +583,8 @@ private function columnToArray(string $fieldName, Mapping\Column $column): array
$mapping['columnDefinition'] = $column->columnDefinition;
}

if ($column->updateable === false) {
$mapping['notUpdateable'] = true;
if ($column->updatable === false) {
$mapping['notUpdatable'] = true;
}

if ($column->insertable === false) {
Expand Down
6 changes: 3 additions & 3 deletions lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ private function joinColumnToArray(SimpleXMLElement $joinColumnElement): array
* unique?: bool,
* nullable?: bool,
* notInsertable?: bool,
* notUpdateable?: bool,
* notUpdatable?: bool,
* version?: bool,
* columnDefinition?: string,
* options?: array
Expand Down Expand Up @@ -845,8 +845,8 @@ private function columnToArray(SimpleXMLElement $fieldMapping): array
$mapping['notInsertable'] = true;
}

if (isset($fieldMapping['updateable']) && ! $this->evaluateBoolean($fieldMapping['updateable'])) {
$mapping['notUpdateable'] = true;
if (isset($fieldMapping['updatable']) && ! $this->evaluateBoolean($fieldMapping['updatable'])) {
$mapping['notUpdatable'] = true;
}

if (isset($fieldMapping['version']) && $fieldMapping['version']) {
Expand Down
8 changes: 4 additions & 4 deletions lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ private function joinColumnToArray(array $joinColumnElement): array
* options?: mixed,
* nullable?: mixed,
* insertable?: mixed,
* updateable?: mixed,
* updatable?: mixed,
* version?: mixed,
* columnDefinition?: mixed
* }|null $column
Expand All @@ -804,7 +804,7 @@ private function joinColumnToArray(array $joinColumnElement): array
* options?: mixed,
* nullable?: mixed,
* notInsertable?: mixed,
* notUpdateable?: mixed,
* notUpdatable?: mixed,
* version?: mixed,
* columnDefinition?: mixed
* }
Expand Down Expand Up @@ -856,8 +856,8 @@ private function columnToArray(string $fieldName, ?array $column): array
$mapping['notInsertable'] = true;
}

if (isset($column['updateable']) && ! (bool) $column['updateable']) {
$mapping['notUpdateable'] = true;
if (isset($column['updatable']) && ! (bool) $column['updatable']) {
$mapping['notUpdatable'] = true;
}

if (isset($column['version']) && $column['version']) {
Expand Down
8 changes: 4 additions & 4 deletions lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use Doctrine\ORM\PersistentCollection;
use Doctrine\ORM\Persisters\Exception\CantUseInOperatorOnCompositeKeys;
use Doctrine\ORM\Persisters\Exception\InvalidOrientation;
use Doctrine\ORM\Persisters\Exception\NonUpdateableField;
use Doctrine\ORM\Persisters\Exception\NonUpdatableField;
use Doctrine\ORM\Persisters\Exception\UnrecognizedField;
use Doctrine\ORM\Persisters\SqlExpressionVisitor;
use Doctrine\ORM\Persisters\SqlValueVisitor;
Expand Down Expand Up @@ -324,7 +324,7 @@ protected function assignDefaultVersionAndUpsertableValues($entity, array $id)

/**
* Fetches the current version value of a versioned entity and / or the values of fields
* marked as 'not insertable' and / or 'not updateable'.
* marked as 'not insertable' and / or 'not updatable'.
*
* @param ClassMetadata $versionedClass
* @param mixed[] $id
Expand All @@ -335,7 +335,7 @@ protected function fetchVersionAndNotUpsertableValues($versionedClass, array $id
{
$columnNames = [];
foreach ($this->class->fieldMappings as $key => $column) {
if (isset($column['notInsertable']) || isset($column['notUpdateable']) || ($this->class->isVersioned && $key === $versionedClass->versionField)) {
if (isset($column['notInsertable']) || isset($column['notUpdatable']) || ($this->class->isVersioned && $key === $versionedClass->versionField)) {
$columnNames[$key] = $this->quoteStrategy->getColumnName($key, $versionedClass, $this->platform);
}
}
Expand Down Expand Up @@ -652,7 +652,7 @@ protected function prepareUpdateData($entity, $isInsert = false)
$fieldMapping = $this->class->fieldMappings[$field];
$columnName = $fieldMapping['columnName'];

if (! $isInsert && isset($fieldMapping['notUpdateable'])) {
if (! $isInsert && isset($fieldMapping['notUpdatable'])) {
continue;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ public function exportClassMetadata(ClassMetadataInfo $metadata)
$fieldXml->addAttribute('insertable', 'false');
}

if (isset($field['notUpdateable'])) {
$fieldXml->addAttribute('updateable', 'false');
if (isset($field['notUpdatable'])) {
$fieldXml->addAttribute('updatable', 'false');
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2202,7 +2202,7 @@ parameters:
path: lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php

-
message: "#^Offset 'version' on array\\{type\\: string, fieldName\\: string, columnName\\?\\: string, length\\?\\: int, id\\?\\: bool, nullable\\?\\: bool, notInsertable\\?\\: bool, notUpdateable\\?\\: bool, \\.\\.\\.\\} in isset\\(\\) does not exist\\.$#"
message: "#^Offset 'version' on array\\{type\\: string, fieldName\\: string, columnName\\?\\: string, length\\?\\: int, id\\?\\: bool, nullable\\?\\: bool, notInsertable\\?\\: bool, notUpdatable\\?\\: bool, \\.\\.\\.\\} in isset\\(\\) does not exist\\.$#"
count: 1
path: lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

/**
* @Entity
* @Table(name="updateable_column")
* @Table(name="updatable_column")
*/
#[Entity, Table(name: 'updateable_column')]
class Updateable
#[Entity, Table(name: 'updatable_column')]
class Updatable
{
/**
* @var int
Expand All @@ -29,22 +29,22 @@ class Updateable

/**
* @var string
* @Column(type="string", name="non_updateable_content", updateable=false)
* @Column(type="string", name="non_updatable_content", updatable=false)
*/
#[Column(type: 'string', name: 'non_updateable_content', updateable: false)]
public $nonUpdateableContent;
#[Column(type: 'string', name: 'non_updatable_content', updatable: false)]
public $nonUpdatableContent;

/**
* @var string
* @Column(type="string", updateable=true)
* @Column(type="string", updatable=true)
*/
#[Column(type: 'string', updateable: true)]
public $updateableContent;
#[Column(type: 'string', updatable: true)]
public $updatableContent;

public static function loadMetadata(ClassMetadata $metadata)
{
$metadata->setPrimaryTable(
['name' => 'updateable_column']
['name' => 'updatable_column']
);

$metadata->mapField(
Expand All @@ -57,12 +57,12 @@ public static function loadMetadata(ClassMetadata $metadata)

$metadata->mapField(
[
'fieldName' => 'nonUpdateableContent',
'notUpdateable' => true,
'fieldName' => 'nonUpdatableContent',
'notUpdatable' => true,
]
);
$metadata->mapField(
['fieldName' => 'updateableContent']
['fieldName' => 'updatableContent']
);

return $metadata;
Expand Down
Loading

0 comments on commit 9674f31

Please sign in to comment.