Row
class Row (View source)
Stores a row.
Constants
| PROPERTY_SEPARATOR |
Level separator of destination and source properties. |
Properties
| protected array | $source | The actual values of the source row. |
|
| protected array | $sourceIds | The source identifiers. |
|
| protected array | $destination | The destination values. |
|
| protected array | $idMap | The mapping between source and destination identifiers. |
|
| protected bool | $frozen | Whether the source has been frozen already. |
|
| protected array | $rawDestination | The raw destination properties. |
|
| protected bool | $isStub | TRUE when this row is a stub. |
|
| protected array | $emptyDestinationProperties | The empty destination properties. |
Methods
Constructs a \Drupal\migrate\Row object.
Retrieves the values of the source identifiers.
Determines whether a source has a property.
Retrieves a source property.
Returns the whole source array.
Sets a source property if the row is not frozen.
Freezes the source.
Clones the row with an empty set of destination values.
Tests if destination property exists.
Sets destination properties.
Removes destination property.
Sets a destination to be empty.
Gets the empty destination properties.
Returns the whole destination array.
Returns the raw destination. Rarely necessary.
Returns the value of a destination property.
Retrieve a source or destination property.
Retrieve multiple source and destination properties at once.
Sets the Migrate ID mappings.
Retrieves the Migrate ID mappings.
Recalculates the hash for the row.
Checks whether the row has changed compared to the original ID map.
Returns if this row needs an update.
Returns the hash for the source values.
Reports whether this row is a stub.
Details
__construct(array $values = [], array $source_ids = [], bool $is_stub = FALSE)
Constructs a \Drupal\migrate\Row object.
array
getSourceIdValues()
Retrieves the values of the source identifiers.
bool
hasSourceProperty(string $property)
Determines whether a source has a property.
mixed|null
getSourceProperty(string $property)
Retrieves a source property.
This function directly retrieves a source property. It does not unescape '@' symbols. This is most useful in source plugins when you don't want to worry about escaping '@' symbols. If using this in a process plugin to retrieve a source property based on a configuration value, consider if the ::get() function might be more appropriate, to allow the migration to potentially specify a destination key as well.
array
getSource()
Returns the whole source array.
setSourceProperty(string $property, mixed $data)
Sets a source property if the row is not frozen.
This can only be called from the source plugin.
$this
freezeSource()
Freezes the source.
Row
cloneWithoutDestination()
Clones the row with an empty set of destination values.
bool
hasDestinationProperty(array|string $property)
Tests if destination property exists.
setDestinationProperty(string $property, mixed $value)
Sets destination properties.
removeDestinationProperty(string $property)
Removes destination property.
setEmptyDestinationProperty(string $property)
Sets a destination to be empty.
array
getEmptyDestinationProperties()
Gets the empty destination properties.
array
getDestination()
Returns the whole destination array.
array
getRawDestination()
Returns the raw destination. Rarely necessary.
For example calling setDestination('foo/bar', 'baz') results in
mixed
getDestinationProperty(string $property)
Returns the value of a destination property.
This function directly returns a destination property. The property name should not begin with an @ symbol. This is most useful in a destination plugin.
mixed|null
get(string $property)
Retrieve a source or destination property.
If the property key begins with '@' return a destination property, otherwise return a source property. the '@' symbol itself can be escaped as '@@'. Returns NULL if property is not found. Useful in process plugins to retrieve a row property specified in a configuration key which may be either a source or destination property prefixed with an '@'.
array
getMultiple(array $properties)
Retrieve multiple source and destination properties at once.
setIdMap(array $id_map)
Sets the Migrate ID mappings.
array
getIdMap()
Retrieves the Migrate ID mappings.
rehash()
Recalculates the hash for the row.
bool
changed()
Checks whether the row has changed compared to the original ID map.
bool
needsUpdate()
Returns if this row needs an update.
mixed
getHash()
Returns the hash for the source values.
.
bool
isStub()
Reports whether this row is a stub.