<?php

namespace Modules\Stock\Trait\Validator;

trait BonValidatorTrait
{
    /**
     * @param array<string,string> $enteteEntity
     * @return self
     */
    public function validateMag(array $enteteEntity): self
    {
        $this->zoom(
            'Hastutil',
            $enteteEntity['MAG'],
            $this->trad->t('Magasinier'),
            $this->pdo,
            false,
            ['MAGASIN' => '1', 'filter_egal_CODE' => $enteteEntity['MAG']]
        );

        return $this;
    }

    /**
     * @param array<string,mixed> $bonEntree
     * @return $this
     */
    public function validateOrigine(array $bonEntree): self
    {
        $this->isStringAvecEspace($this->trad->t('Origine'), $bonEntree['ORIGINE'], 0, 30);

        return $this;
    }
}
