public function sku(array $values)
    {
        $count = count($values);

        $existing = array_filter($values, function ($sku) {
            $sku = $this->sku->get(array('sku' => $sku));
            return !empty($sku);
        });

        if ($count != count($existing)) {
            return $this->translation->text('@name is unavailable', array(
                '@name' => $this->translation->text('SKU')));
        }

        return true;
    }
public function sku(array $values)
    {
        $count = count($values);

        $existing = array_filter($values, function ($sku) {
            $sku = $this->sku->get(array('sku' => $sku));
            return !empty($sku);
        });

        if ($count != count($existing)) {
            return $this->translation->text('@name is unavailable', array(
                '@name' => $this->translation->text('SKU')));
        }

        return true;
    }
public function sku ( array $ values ) { $ count = count ( $ values ) ; $ existing = array_filter ( $ values , function ( $ sku ) { $ sku = $ this -> sku -> get ( array ( 'sku' => $ sku ) ) ; return ! empty ( $ sku ) ; } ) ; if ( $ count != count ( $ existing ) ) { return $ this -> translation -> text ( '@name is unavailable' , array ( '@name' => $ this -> translation -> text ( 'SKU' ) ) ) ; } return true ; }
Validates the SKU condition
@param array $values
@return boolean|string
Validates the SKU condition