protected function getKeys(array $entities, $key = null)
    {
        if (is_null($key)) {
            $key = $this->relatedMap->getKeyName();
        }

        $host = $this;

        return array_unique(array_values(array_map(function ($value) use ($key, $host) {
            if (!$value instanceof InternallyMappable) {
                $value = $host->factory->make($value);
            }

            return $value->getEntityAttribute($key);
        }, $entities)));
    }
protected function getKeys(array $entities, $key = null)
    {
        if (is_null($key)) {
            $key = $this->relatedMap->getKeyName();
        }

        $host = $this;

        return array_unique(array_values(array_map(function ($value) use ($key, $host) {
            if (!$value instanceof InternallyMappable) {
                $value = $host->factory->make($value);
            }

            return $value->getEntityAttribute($key);
        }, $entities)));
    }
protected function getKeys ( array $ entities , $ key = null ) { if ( is_null ( $ key ) ) { $ key = $ this -> relatedMap -> getKeyName ( ) ; } $ host = $ this ; return array_unique ( array_values ( array_map ( function ( $ value ) use ( $ key , $ host ) { if ( ! $ value instanceof InternallyMappable ) { $ value = $ host -> factory -> make ( $ value ) ; } return $ value -> getEntityAttribute ( $ key ) ; } , $ entities ) ) ) ; }
Get all of the primary keys for an array of entities.

@param array  $entities
@param string $key

@return array
Get all of the primary keys for an array of entities .