Commit d5aeeb74 authored by Marcelo Rivera's avatar Marcelo Rivera
Browse files

(fix): 1 = safe; 2 = open

parent 50260574
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -82,6 +82,11 @@ class Campaign implements JsonSerializable
    /** @var string */
    /** @var string */
    const COMPLETED_STATUS = 'completed';
    const COMPLETED_STATUS = 'completed';


    /** @var int  */
    const SAFE_RATING = 1;
    /** @var int  */
    const OPEN_RATING = 2;

    /** @var string */
    /** @var string */
    protected $urn;
    protected $urn;


@@ -211,7 +216,7 @@ class Campaign implements JsonSerializable
    public function setNsfw($value)
    public function setNsfw($value)
    {
    {
        $this->nsfw = $value;
        $this->nsfw = $value;
        $this->setRating(count($this->getNsfw()) > 0 ? 0 : 1); // 0 = open; 1 = safe
        $this->setRating(count($this->getNsfw()) > 0 ? static::OPEN_RATING : static::SAFE_RATING); // 2 = open; 1 = safe


        return $this;
        return $this;
    }
    }