Validates combination stock price
@param integer $index
@param array $combination
@return boolean
325147
protected function validateCombinationPriceProduct($index, &$combination)
    {
        $price = $this->getSubmitted('price');

        if (empty($combination['price'])) {
            $combination['price'] = $price;
        }

        if (!is_numeric($combination['price']) || strlen($combination['price']) > 10) {
            $error = $this->translation->text('Only numeric values and no longer than @num characters', array('@num' => 10));
            $this->setError("combination.$index.price", $error);
        }

        return !isset($error);
    }
1253825
protected function validateCombinationOptionsProduct($index, &$combination)
    {
        $options = $this->getSubmitted('product_fields.option');

        if (empty($options)) {
            return null;
        }

        $errors = 0;

        foreach ($options as $field_id => $field) {
            if (!empty($field['required']) && !isset($combination['fields'][$field_id])) {
                $this->setErrorRequired("combination.$index.fields.$field_id", $field['title']);
                $errors++;
            }
        }

        return empty($errors);
    }
52547
public static function getArrayBaseValue($index, $default = [])
    {
        $values = (array) self::getCustom($index, []);

        return array_merge((array) self::get($index, $default), $values);
    }
1039789
private function ValidateData(&$array, $index = '', $xss_clean = false) {
        if (!isset($array[$index])) {
            return false;
        }

        if ($xss_clean === true && !($array[$index] instanceof \stdClass)) {
            $array[$index] = strip_tags($array[$index]);
            $array[$index] = filter_var($array[$index]);
//$security = new BL\Security\Security();
            //return $security->xss_clean($array[$index]);
        }

        return $array[$index];
    }
850093
public function offsetExists($index)
    {
        if (!$exists = parent::offsetExists($index)) {
            if (isset($this->{$index})) {
                return true;
            }
        }
        return $exists;
    }
589695
public function actionRemoveCombination(int $combinationId)
    {
        $combination = Combination::findOne($combinationId);
        if (empty($combination)) throw new NotFoundHttpException('Such combination does not exists');
        $productId = $combination->product_id;

        if (!empty($combination)) {
            $combination->delete();
            if (Combination::find()->where(['product_id' => $productId])->count() == 1) {
                $combination = Combination::find()->where(['product_id' => $productId])->one();
                $combination->default = 1;
                if ($combination->validate()) $combination->save();
            }

            $eventName = self::EVENT_AFTER_EDIT_PRODUCT;
            $this->trigger($eventName, new ProductEvent([
                'id' => $combination->product_id
            ]));

        } else throw new NotFoundHttpException();

        return $this->redirect(\Yii::$app->request->referrer);
    }
511667
public function itemAt ($index) {
        if (isset($this->_d[$index]))
            return $this->_d[$index];
        elseif ($index >= 0 && $index < $this->_c) // in case the value is null
            return $this->_d[$index];
        else
            throw new Exception(Yii::t ('yii' , 'List index "{index}" is out of bound.' ,
                array('{index}' => $index)));
    }
1242007
public function has($name, $index = 0)
    {
        $lowerName = strtolower($name);

        if (!array_key_exists($lowerName, $this->headers)) {
            return false;
        }

        if (func_num_args() < 2) {
            // index was not specified, so we only need to check that there is at least one header value set
            return (bool) count($this->headers[$lowerName]);
        }

        return array_key_exists($index, $this->headers[$lowerName]);
    }
544126
public function getRow($index)
    {
        if (!isset($this->rows[$index])) {
            throw new DcGeneralInvalidArgumentException('Row ' . $index . ' does not exist.');
        }

        return $this->rows[$index];
    }
34672
public function getValueFromIndex( $index )
	{
		$dimension	= $this->getDimension();
		if( $index < 0 )
			throw new OutOfRangeException( 'Vector Index ('.$index.') must be greater than 0.' );
		if( $index >= $dimension )
			throw new OutOfRangeException( 'Vector Index ('.$index.') must be lower than Vector Dimension ('.$dimension.').' );
		return $this->values[$index];
	}
874224
private function mergeArrayFromIndex(array $to, array $from, $index = 0)
    {
        $size = count($from);

        if ($size > $index) for ($i = $index; $i < $size; ++$i) $to[] = $from[$i];

        return $to;
    }
894720
private function needToResend($index, $result)
    {
        if (array_key_exists(self::ERROR, $result) && (in_array(self::UNAVAILABLE, $result) || in_array(self::DEVICE_MESSAGE_RATE_EXCEEDED, $result) || in_array(self::INTERNAL_SERVER_ERROR, $result))) {
            if ($this->tokens[$index]) {
                $this->tokensToRetry[] = $this->tokens[$index];
            }

            return true;
        }

        return false;
    }
572046
public function hasIndex($index, $collection)
    {
        if (empty($this->queriesResultCache[ 'collectionIndexes' ][ $collection ])) {
            $this->getIndexes($collection);
        }

        return (bool)in_array($index, $this->queriesResultCache[ 'collectionIndexes' ][ $collection ]);
    }
1306637
public function saveSelectedCombinationToSession($combination)
    {
        if (!empty($combination)) {
            $items = Yii::$app->session[self::SESSION_KEY_SELECTED_COMBINATIONS];
            $itemIsExist = false;

            if(!empty($items)) {
                foreach ($items as $key => $item) {
                    if ($item['productId'] == $combination->product_id) {
                        $items[$key]['combinationId'] = $combination->id;
                        $itemIsExist = true;
                    }
                }
            }
            if (!$itemIsExist) {
                $items[] = [
                    'productId' => $combination->product_id,
                    'combinationId' => $combination->id,
                ];
            }

            Yii::$app->session[self::SESSION_KEY_SELECTED_COMBINATIONS] = $items;

            return true;
        }

        return false;
    }
441174
public static function validIndex( $index, $value )
    {
        if ( is_array( $value ) )
        {
            return ( count( $value ) > $index && $index >= 0 );
        }
        elseif ( is_string( $value ) )
        {
            return ( strlen( $value ) > $index && $index >= 0 );
        }

        return FALSE;
    }
972059
public function error($index = false)
    {
        if (isset($this->upload['error'])) {
            if ($index === false) {
                    return $this->upload['error'];
            }
            return $this->upload['error'][$index];
        }
        return false;
    }
647151
function item($item, $index = '')
	{
		if ($index == '')
		{
			if ( ! isset($this->config[$item]))
			{
				return FALSE;
			}

			$pref = $this->config[$item];
		}
		else
		{
			if ( ! isset($this->config[$index]))
			{
				return FALSE;
			}

			if ( ! isset($this->config[$index][$item]))
			{
				return FALSE;
			}

			$pref = $this->config[$index][$item];
		}

		return $pref;
	}