@param string $location
@param bool   $required
@param string $description

@return static
961762
public static function build($location, $required, $description)
    {
        $param = new static();
        $param->location = $location;
        $param->required = $required;
        $param->description = $description;

        return $param;
    }
392988
public function requires($addon = 'atk', $v, $location = null)
    {
        $cv = $this->getVersion($addon);
        if (version_compare($cv, $v) < 0) {
            if ($addon == 'atk') {
                $e = $this->exception('Agile Toolkit version is too old');
            } else {
                $e = $this->exception('Add-on is outdated')
                    ->addMoreInfo('addon', $addon);
            }
            $e->addMoreInfo('required', $v)
                ->addMoreInfo('you have', $cv);
            if ($location !== null) {
                $e->addMoreInfo('download_location', $location);
            }
            throw $e;
        }

        // Possibly we need to enable compatibility version
        if ($addon == 'atk') {
            if (version_compare($v, '4.2') < 0 && version_compare($v, '4.1.4') >= 0) {
                $this->add('Controller_Compat');

                return true;
            }
        }

        return true;
    }
725244
public function addPackage($name, $location = null, $main = null)
    {
        $name = (string)$name;

        if ($name == '') {
            throw new exception\InvalidArgumentException('The require.js package name must not be empty');
        }

        if (!$location && !$main) {
            $this->packages[$name] = $name;
            return $this;
        }

        $this->packages[$name] = [
            'name' => $name,
        ];

        if ($location) {
            $this->packages[$name]['location'] = (string)$location;
        }

        if ($main) {
            $this->packages[$name]['main'] = (string)$main;
        }

        return $this;
    }
1265092
public function update(UpdateStruct $location, $locationId)
    {
        $query = $this->handler->createUpdateQuery();

        $query
            ->update($this->handler->quoteTable('ezcontentobject_tree'))
            ->set(
                $this->handler->quoteColumn('priority'),
                $query->bindValue($location->priority)
            )
            ->set(
                $this->handler->quoteColumn('remote_id'),
                $query->bindValue($location->remoteId)
            )
            ->set(
                $this->handler->quoteColumn('sort_order'),
                $query->bindValue($location->sortOrder)
            )
            ->set(
                $this->handler->quoteColumn('sort_field'),
                $query->bindValue($location->sortField)
            )
            ->where(
                $query->expr->eq(
                    $this->handler->quoteColumn('node_id'),
                    $locationId
                )
            );
        $statement = $query->prepare();
        $statement->execute();

        // Commented due to EZP-23302: Update Location fails if no change is performed with the update
        // Should be fixed with PDO::MYSQL_ATTR_FOUND_ROWS instead
        /*if ( $statement->rowCount() < 1 )
        {
            throw new NotFound( 'location', $locationId );
        }*/
    }
1207834
public function addSearchLocation($location)
    {
        if (!file_exists($location)) {
            throw new \InvalidArgumentException(
                sprintf("The location path %s is not valid.", $location)
            );
        }

        $this->searchLocations[] = $location;

        return $this;
    }
1262417
public function setRequired(bool $required) : self
    {
        $required = (bool)$required;
        $this->required = $required;
        return $this;
    }
1181726
public function required($required = true, $required_value = true)
    {
        if ($required == $required_value) {
            $this->addClass('required');
            $this->aria('required', 'true');

            return parent::attr('required', 'required');
        }

        return $this;
    }
1324019
public function addLocation($location, $data = null)
  {
    if(InUseLocation::isValid($location))
    {
      $this->locations[] = [$location, $data];
    }
    return $this;
  }
1317136
public function setLocation(Location $location = null)
    {
        $this->location = $location;

        $this->setStartDate(new \DateTime('now', new \DateTimeZone('UTC')));

        return $this;
    }
42578
protected function setParams($position, $required, $param)
    {
        if (!empty($required['class']) && !is_a($param, $required['class'])) {
            $this->errors[] = sprintf("You can't put an instance of %s in the parameter #%s $%s of type %s",
                get_class($param), $position, $required['name'], $required['class']);
            return false;
        }
        $this->methodParams[$position] = $param;
    }
588229
public function addVisitor($location, RequestVisitorInterface $visitor)
    {
        $this->factory->addRequestVisitor($location, $visitor);

        return $this;
    }
879543
public function addVideo($location, $title = null, $description = null, $thumbnailLocation = null)
    {
        $video = $location instanceof VideoTag ? $location : new VideoTag($location, $title, $description, $thumbnailLocation);

        $this->videos[] = $video;
    }
1191090
public function addItem($title, $url, array $attributes = array(), $location = null)
	{
		return $this->addItemInstance($this->makeItem($title, $url, $attributes), $location);
	}
1323702
public function setDescription($description)
    {
        self::writeFullTag(
            $description,
            'description',
            true,
            'video:description',
            $this->validator,
            'validateDescription',
            $this->exception,
            'Provided description value is not a valid.'
        );

        return $this;
    }
592327
public function markRequired($elTpl, $required)
    {
        if ($required) {
            $this->hasRequired = true;
            $elTpl = str_replace(array('<qf:required>', '</qf:required>'),
                                  array('', ''), $elTpl);
        } else {
            $elTpl = preg_replace('!<qf:required>.*</qf:required>!isU', '', $elTpl);
        }
        return $elTpl;
    }
8682
public function create(Description $description)
    {
        return new ContactEntity(
            $description->getOptionalProperty('phone'),
            $description->getOptionalProperty('twitter'),
            $description->getOptionalProperty('facebook')
        );
    }
967229
public function addOptional(string $short, string $long, string $description = '', string $placeholder = 'value')
    {
        $this->addOption(self::OPTIONAL, $short, $long, $description, $placeholder);
        return $this;
    }