Sets the probability of the product in the recipe.
@param float $probability
@return $this Implementing fluent interface.
16738
public function setProbability(float $probability): self
    {
        $this->probability = (int) ($probability * self::FACTOR_AMOUNT_PROBABILITY);
        return $this;
    }
36930
public function setProduct($product)
    {
        $this->setSku($product->getSku());
        $this->setName($product->getName());

        return $this;
    }
263058
public function setMax(float $max) : self
    {
        $this->getField()->addAttribute('max', (string) $max);

        return $this;
    }
397497
public function setPriority($p)
    {
        $this->priority = $p;
        if ($this->ev !== null) {
            $this->ev->priority = $p;
        }
    }
1130955
public function setAvailability($availability)
    {
        $allowedValues = $this->getAvailabilityAllowableValues();
        if (!in_array($availability, $allowedValues)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'availability', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['availability'] = $availability;

        return $this;
    }
836098
public function setSize(float $size) {
        if(!$this->setModified('size', $size)->isModified()) {
            return $this;
        }
		$this->size = $size;
		return $this;
    }
333676
public function setQuantity(int $quantity): self
    {
        $this->quantity = $quantity;
        $this->updateTotalPrice();
        $this->updateTotalRetailPrice();

        return $this;
    }
1285136
public function setError($error)
  {
    if ( !($error instanceof Exception) && is_string($error) ){
      $error = new Exception($error);
    }
    
    array_push($this->errors, $error);
    
    return $this;
  }
725510
public function setDealerBrand(ChildDealerBrand $v = null)
    {
        if ($v === null) {
            $this->setId(NULL);
        } else {
            $this->setId($v->getId());
        }

        $this->aDealerBrand = $v;

        // Add binding for other direction of this n:n relationship.
        // If this object has already been added to the ChildDealerBrand object, it will not be re-added.
        if ($v !== null) {
            $v->addDealerBrandVersion($this);
        }


        return $this;
    }
188175
public function float()
    {
        if (!is_float($this->value)) {
            throw new InvalidFloatException($this->name, $this->value);
        }

        return $this;
    }
1302865
public function setPrice($price)
    {
        if ($price instanceof Amount) {
            $price = $price->getNumber();
        }
        $this->price = $price;

        return $this;
    }
35234
public static function gcProbability($probability = null)
	{
		if (null === $probability)
		{
			return ini_get('session.gc_probability') / ini_get('session.gc_divisor');
		}
		else
		{
			ini_set('session.gc_probability', 1);
			ini_set('session.gc_divisor', 1 / $probability);
			return $probability;
		}
	}
285573
public function setProduct(\HarvestCloud\CoreBundle\Entity\Product $product = null)
    {
        $this->product = $product;

        return $this;
    }
74876
public function setResult($result): self
    {
        $this->_result = $result;
        $this->_hasResult = true;

        return $this;
    }
197914
public function setPrice($product)
    {
        $this->price = (float)number_format($product->getFinalPrice(), 2, '.', '');
        $total = $this->price * $this->qty;

        $this->totalValueOfProduct = (float)number_format($total, 2, '.', '');

        return $this;
    }
410618
public function setPubDate($pubDate)
    {
        if ($pubDate instanceof \DateTime) {
            $this->pubDate = $pubDate;
        } else {
            $this->pubDate = new \DateTime($pubDate);
        }

        return $this;
    }
1279483
public function setAmountMax(float $amountMax): self
    {
        $this->amountMax = (int) ($amountMax * self::FACTOR_AMOUNT_MAX);
        return $this;
    }