Prepares an array of product data
@param array $product
350154
protected function prepareProductReview(array &$product)
    {
        $this->setItemImages($product, 'product', $this->image);
        $this->setItemThumbProduct($product, $this->image);
        $this->setItemPriceCalculated($product, $this->product);
        $this->setItemPriceFormatted($product, $this->price, $this->current_currency);
    }
171681
private function preparePreviewItems($products = [])
    {
        $items = [];

        foreach ($products as $product) {
            $items[$product->getId()] = $this->itemFactory->getData($product);
        }

        return array_values($items);
    }
943927
public static function prepare($params = [])
    {
        $positions = array_combine(array_keys($params), array_fill(0, count($params), 0));
        $data = [];

        do {
            $data[] = self::getByIndexes($params, $positions);
        } while (self::updateIndexesToNextIteration($params, $positions));

        return $data;
    }
81909
public void setProduct(final String product) {
        if (product == null && this.product == null) {
            return;
        } else if (product == null) {
            removeChild(this.product);
            this.product = null;
        } else if (this.product == null) {
            this.product = new KeyValueNode<String>(CommonConstants.CS_PRODUCT_TITLE, product);
            appendChild(this.product, false);
        } else {
            this.product.setValue(product);
        }
    }
36930
public function setProduct($product)
    {
        $this->setSku($product->getSku());
        $this->setName($product->getName());

        return $this;
    }
69929
public function init()
    {

        // initialize the prepared statements
        $this->productTextsStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::PRODUCT_TEXTS));
    }
1181478
public function init()
    {

        // initialize the prepared statements
        $this->productIntsStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::PRODUCT_INTS));
    }
548353
public function setProducts(array $products)
    {
        $this->products = array_values(array_filter($products, function ($product): bool {
            return $product instanceof Product;
        }));
        return $this;
    }
25284
public function preLoadEntityId(array $product)
    {
        $this->preLoadedEntityIds[$product[MemberNames::SKU]] = $product[MemberNames::ENTITY_ID];
    }
94349
public function create(Product $product)
    {
        $this->getEm()->persist($product);
        $this->getEm()->flush();

        return $product;
    }
1181951
private function prepareFieldValue(ProductCondition $productCondition)
    {
        $value = $productCondition->getValue();

        if (is_array($value)) {
            $value = array_filter($value);
        }

        $productCondition->setValue($value);

        return $this;
    }
170583
protected function indexProductTranslations(array $product)
    {
        if (empty($product['translation'])) {
            return false;
        }

        $indexed = 0;

        foreach ($product['translation'] as $language => $translation) {
            $translation += $product;
            $snippet = $this->search->getSnippet($translation, $language);
            $indexed += (int) $this->search->setIndex($snippet, 'product', $product['product_id'], $language);
        }

        return $indexed > 0;
    }
144314
protected function updateProductsFeatures(array $attributes, $products)
    {
        $products->each(function ($item, $key) use ($attributes, $products) {
            $item->update(['features' => json_encode($attributes[$item->id])]);
            $item->save();
        });
    }
1150677
public function setProduct(ProductInterface $product)
    {
        $this->productId = $product->getId();
        $this->product = $product;
    }
659826
protected function prepareProduct(array &$product)
    {
        $options = array(
            'store_id' => $product['store_id'],
            'product_id' => $product['product_id']
        );

        $product['related'] = $this->product->getRelated($options);
        $product['price'] = $this->price->decimal($product['price'], $product['currency']);

        $this->setSkuCombinationProduct($product);
        $this->setItemAlias($product, 'product', $this->alias);
        $this->setItemImages($product, 'product', $this->image);
        $this->setItemTranslation($product, 'product', $this->translation_entity);

        if (!empty($product['images'])) {
            foreach ($product['images'] as &$file) {
                $this->setItemTranslation($file, 'file', $this->translation_entity);
            }
        }
    }
246569
protected static function prepareArrayLines(array $array)
    {
        $isAssoc = Arr::isAssoc($array);

        array_walk($array, function (&$value, $index, $withIndexes = false) {
            if (is_array($value)) {
                $value = self::formatArray($value);
            } else {
                $value = self::formatScalar($value);
            }

            if ($withIndexes) {
                $value = self::formatScalar($index) . ' => ' . $value;
            }
        }, $isAssoc);

        return $array;
    }
954827
protected function setIds(array $product)
    {
        $this->setLastEntityId(isset($product[MemberNames::ENTITY_ID]) ? $product[MemberNames::ENTITY_ID] : null);
    }