# assistant/0.3.1/backend/src/Data/Transformers/LabelsTransformer.php

Assistant – Every Day Productivity Apps, version 0.3.1. 25 lines.

- Page: https://pluginprobe.com/plugins/assistant/0.3.1/code/backend/src/Data/Transformers/LabelsTransformer.php
- Raw: https://pluginprobe.com/plugins/assistant/0.3.1/raw/backend/src/Data/Transformers/LabelsTransformer.php
- Modified: 2020-03-25T19:33:50+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/assistant/0.3.1/code/backend/src/Data/Transformers/LabelsTransformer.php#L10-L20`.

```php
<?php


namespace FL\Assistant\Data\Transformers;

use FL\Assistant\Data\Repository\LabelsRepository;

class LabelsTransformer {

	protected $labels;

	public function __construct( LabelsRepository $labels ) {
		$this->labels = $labels;
	}

	public function __invoke( \WP_Term $term ) {
		return [
			'id'    => $term->term_id,
			'label' => $term->name,
			'slug'  => $term->slug,
			'color' => get_term_meta( $term->term_id, $this->labels::FL_ASST_NOTATION_COLOR, true ),
		];
	}
}

```
