Neomerx\JsonApi\Contracts\Schema\SchemaProviderInterface::getAttributes PHP Method

getAttributes() public method

Get resource attributes.
public getAttributes ( object $resource ) : array
$resource object
return array
    public function getAttributes($resource);

Usage Example

 /**
  * @inheritdoc
  */
 public function getAttributes()
 {
     if ($this->attributes === null) {
         $attributes = $this->schema->getAttributes($this->resource);
         if ($this->attributeKeysFilter !== null) {
             $attributes = array_intersect_key($attributes, $this->attributeKeysFilter);
         }
         $this->attributes = $attributes;
     }
     return $this->attributes;
 }