*/ private array $categories; /** * Preview tags. * * @var list */ private array $tags; /** * Validation errors for this row. * * @var list */ private array $errors; /** * @param int $rowNumber CSV row number. * @param string $action Planned action. * @param string $provider Provider key. * @param string $providerItemId Provider-side identifier. * @param string $title Product title. * @param string $lifecycleState Lifecycle state. * @param list $categories Categories. * @param list $tags Tags. * @param list $errors Validation errors. */ public function __construct( int $rowNumber, string $action, string $provider, string $providerItemId, string $title, string $lifecycleState, array $categories = array(), array $tags = array(), array $errors = array() ) { $this->rowNumber = $rowNumber; $this->action = $action; $this->provider = $provider; $this->providerItemId = $providerItemId; $this->title = $title; $this->lifecycleState = $lifecycleState; $this->categories = array_values( $categories ); $this->tags = array_values( $tags ); $this->errors = array_values( $errors ); } /** * CSV row number. */ public function rowNumber(): int { return $this->rowNumber; } /** * Planned action. */ public function action(): string { return $this->action; } /** * Provider key. */ public function provider(): string { return $this->provider; } /** * Provider item id. */ public function providerItemId(): string { return $this->providerItemId; } /** * Product title. */ public function title(): string { return $this->title; } /** * Lifecycle state. */ public function lifecycleState(): string { return $this->lifecycleState; } /** * Categories. * * @return list */ public function categories(): array { return $this->categories; } /** * Tags. * * @return list */ public function tags(): array { return $this->tags; } /** * Row validation errors. * * @return list */ public function errors(): array { return $this->errors; } /** * Whether the row passed validation. */ public function isValid(): bool { return $this->errors === array(); } }