Returns primary values of enitities in relationship.
@return mixed[]
431247
public function getRawValue(): array
	{
		$primaryValues = [];
		foreach ($this->getIterator() as $entity) {
			if ($entity->isPersisted()) {
				$primaryValues[] = $entity->getValue('id');
			}
		}
		return $primaryValues;
	}
733364
public function getPrimaryKeyColumns()
    {
        $primaryKey = $this->getPrimaryKey();

        if ($primaryKey === null) {
            throw new DBALException('Table ' . $this->getName() . ' has no primary key.');
        }

        return $primaryKey->getColumns();
    }
299519
public function getAttributes()
    {
        return [
            Attributes\IdAttribute::make(),
            Attributes\BelongsToAttribute::make('target_id')
                ->setRelationName('target')
                ->setRelationManager(TargetManager::class)
                ->setRequired(true),
            Attributes\EnumAttribute::make('targetable_type', app('amethyst')->getMorphListable('targetable', 'targetable'))
                ->setRequired(true),
            Attributes\MorphToAttribute::make('targetable_id')
                ->setRelationKey('targetable_type')
                ->setRelationName('targetable')
                ->setRelations(app('amethyst')->getMorphRelationable('targetable', 'targetable'))
                ->setRequired(true),
            Attributes\CreatedAtAttribute::make(),
            Attributes\UpdatedAtAttribute::make(),
            Attributes\DeletedAtAttribute::make(),
        ];
    }
1224175
public function primaryKey()
    {
        $primaryKeys = [];
        foreach ($this->_columns as $name => $data) {
            if ((!array_key_exists('primaryKey', $data)) || ($data['primaryKey'] !== true)) {
                continue;
            }

            $primaryKeys[] = $name;
        }

        return $primaryKeys;
    }
798873
public function getRelationships(): array
    {
        $relationships = [];
        if ($this->hasTransformer()) {
            if (($transformer = $this->getTransformer()) instanceof TransformerInterface) {
                $relationships = $transformer->getRelationships();
            }
        }

        return $relationships;
    }
140287
public function getAttributes()
    {
        return [
            Attributes\IdAttribute::make(),
            Attributes\TextAttribute::make('name')
                ->setRequired(true),
            Attributes\TextAttribute::make('code'),
            Attributes\BelongsToAttribute::make('legal_entity_id')
                ->setRelationName('legal_entity')
                ->setRelationManager(LegalEntityManager::class),
            Attributes\CreatedAtAttribute::make(),
            Attributes\UpdatedAtAttribute::make(),
            Attributes\DeletedAtAttribute::make(),
        ];
    }
1321378
public function getPossibleParents() {
    $result = [];
    $relations = $this->getRelations('parent');
    foreach ($relations as $curRelation) {
      $result[$curRelation->getOtherRole()] = $curRelation;
    }
    return $result;
  }
794222
public function getDefaultValuesForProperties()
    {
        $this->initialize();
        if (!isset($this->fullConfiguration['properties'])) {
            return [];
        }

        $defaultValues = [];
        foreach ($this->fullConfiguration['properties'] as $propertyName => $propertyConfiguration) {
            if (isset($propertyConfiguration['defaultValue'])) {
                $type = isset($propertyConfiguration['type']) ? $propertyConfiguration['type'] : '';
                switch ($type) {
                    case 'DateTime':
                        $defaultValues[$propertyName] = new \DateTime($propertyConfiguration['defaultValue']);
                    break;
                    default:
                        $defaultValues[$propertyName] = $propertyConfiguration['defaultValue'];
                }
            }
        }

        return $defaultValues;
    }
289957
public function getTypeAllowableValues()
    {
        return [
            self::TYPE_PARENTGUARDIAN,
            self::TYPE_EMERGENCY,
            self::TYPE_PRIMARY,
            self::TYPE_SECONDARY,
            self::TYPE_FAMILY,
            self::TYPE_OTHER,
            self::TYPE_EMPTY,
        ];
    }
652445
protected function getForeignKeyRelations() {
    if ($this->fkRelations == null) {
      $this->fkRelations = [];
      $relationDescs = $this->getRelations();
      foreach($relationDescs as $relationDesc) {
        if ($relationDesc instanceof RDBManyToOneRelationDescription) {
          $this->fkRelations[] = $relationDesc;
        }
      }
    }
    return $this->fkRelations;
  }
118006
public function getPrimaryKeys(): array
    {
        $primaryColumns = [];
        foreach ($this->getColumns() as $column) {
            if ($column->getAbstractType() == 'primary' || $column->getAbstractType() == 'bigPrimary') {
                if (!in_array($column->getName(), $this->primaryKeys)) {
                    //Only columns not listed as primary keys already
                    $primaryColumns[] = $column->getName();
                }
            }
        }

        return array_unique(array_merge($this->primaryKeys, $primaryColumns));
    }
1311661
public function getValues()
        {
            $values = [];

            foreach ($this->parts as $part) {
                if ($part instanceof Criterion) {
                    if ($part->getValue() !== null) {
                        $values[] = $part->getValue();
                    }
                } else {
                    foreach ($part->getValues() as $value) {
                        if ($value !== null) {
                            $values[] = $value;
                        }
                    }
                }
            }

            return $values;
        }
784259
protected function fetchPrimaryKeys(): array
    {
        $query = "SHOW INDEXES FROM {$this->driver->identifier($this->getName())}";

        $primaryKeys = [];
        foreach ($this->driver->query($query) as $index) {
            if ($index['Key_name'] == 'PRIMARY') {
                $primaryKeys[] = $index['Column_name'];
            }
        }

        return $primaryKeys;
    }
628112
protected function getPrimaryKey(): array
    {
        $primary = array_flip($this->getTable()->getPrimaryKey());

        return array_intersect_key($this->toArray(), $primary);
    }
378366
protected function buildRelationships()
    {
        if (isset($this->relationships)) {
            return $this->relationships;
        }

        $paths = Util::parseRelationshipPaths($this->includes);

        $relationships = [];

        foreach ($paths as $name => $nested) {
            $relationship = $this->serializer->getRelationship($this->data, $name);

            if ($relationship) {
                $relationshipData = $relationship->getData();
                if ($relationshipData instanceof ElementInterface) {
                    $relationshipData->with($nested)->fields($this->fields);
                }

                $relationships[$name] = $relationship;
            }
        }

        return $this->relationships = $relationships;
    }
1190705
public function getPrimaryKey()
    {
        $pk = [];
        foreach ($this->columns as $col) {
            if ($col->isPrimaryKey()) {
                $pk[] = $col;
            }
        }

        return $pk;
    }
1322655
protected function _primaryKeyValue()
    {
        $fields = (array)$this->_table()->getPrimaryKey();
        $values = [];
        foreach ($fields as $field) {
            $values[] = $this->_deriveFieldFromContext($field);
        }

        if (count($values) === 1) {
            return $values[0];
        }

        return $values;
    }