Method to set property model

@param   Repository $model
@param   bool       $default
@param   string     $customName

@return static Return self to support chaining.

@throws \ReflectionException
@deprecated use repository instead.
359209
public function setModel(Repository $model, $default = null, $customName = null)
    {
        $this->setRepository($model, $default, $customName);

        return $this;
    }
634036
public function apply($model, Repository $repository)
    {
        $model = $model->whereIn('id', $this->ids);

        return $model;
    }
55077
private function setMetadataFromDefaultValue (ReflectionProperty $prop, $v)
  {
    $prop->default = $v;

    // If the type has not yet been defined, it will be defined implicitly via the default value.
    if (!isset($prop->type))
      switch (gettype ($v)) {
        case 'string':
          $prop->type = type::string;
          break;
        case 'boolean':
          $prop->type = type::bool;
          break;
        case 'integer':
        case 'double':
          $prop->type = type::number;
          break;
        case 'NULL':
          // Don't bother setting a NULL default.
          break;
      }
  }
1255243
public function setDefault($default) : Value
    {
        if (isset($default) && !$this->mode->is(Value::OPTIONAL)) {
            throw new \InvalidArgumentException('Cannot set a default value for non-optional values.');
        }

        $this->default = $default;

        return $this;
    }
280663
public function setCustomProperty(string $name, $value): self
    {
        $customProperties = $this->custom_properties;

        array_set($customProperties, $name, $value);

        $this->custom_properties = $customProperties;

        return $this;
    }
702241
public function setRepository(DocumentRepository $repository)
    {
        $this->repository = $repository;
        $this->manager = $repository->getDocumentManager();
        return $this;
    }
1081700
public function setModel($model)
	{
		$this->model = $model;
		
		$this->from($this->model->metableTable() . ' AS m');
		
		if ($this->model->metableTableSoftDeletes()) {
			$this->whereNull('m.' . $this->model->getDeletedAtColumn());
		}
		
		return $this;
	}
598495
public function applyTo($model)
    {
        $this->guardProviderName($model);

        if ($this->setOn) {
            foreach ($this->setOn as $rule) {
                if (!($rule['property'] && isset($rule['value']))) {
                    throw new DcGeneralRuntimeException(
                        'Error Processing root condition, you need to specify property and value: ' . \var_export(
                            $rule,
                            true
                        ),
                        1
                    );
                }

                $model->setProperty($rule['property'], $rule['value']);
            }

            return $this;
        }

        throw new DcGeneralRuntimeException(
            'Error Processing root condition, you need to specify root condition setters.',
            1
        );
    }
313404
public function setModelName($modelName) {
    
    if (!class_exists($modelName))
      throw new Exception("Model '{$modelName}' could not be found");
    
    $model = new \ReflectionClass($modelName);
    
    if (!$model->implementsInterface('\Phalcon\Mvc\ModelInterface'))
      throw new Exception("'{$modelName}' must be an instance of Phalcon\Mvc\ModelInterface");
    
    $this->modelname = $modelName;
    return $this;
  }
647253
public function set(ModelInterface $model, $alias = null)
    {
        $hash = spl_object_hash($model);

        $this->collection[$hash] = &$model;

        if ($alias !== null) {
            $this->byAlias[$model->alias($alias)] = &$this->collection[$hash];
        }

        $this->byEntity[$this->normalizeNamespace($model->entity())] = &$this->collection[$hash];

        return $this;
    }
67656
public static function createReferenceMany(
        string $name,
        callable $repository
    ): DenormalizationFieldMappingBuilderInterface {
        $self = new self($name);
        $self->fieldDenormalizer = new ReferenceManyFieldDenormalizer($repository, new PropertyAccessor($name));

        return $self;
    }
333940
public function setModel($model)
    {
        /** @type Model $model */
        $model = parent::setModel($model);

        foreach ($model as $rule) {
            $this->addRule($rule['rule'], $rule['target'], explode(',', $rule['params']));
        }

        // @todo Consider to return $model instead of $this like we do in setModel method of all other classes
        return $this;
    }
878879
public function set_model( $model )
    {
        // Check that the required arguments are provided.
        foreach( $this->required_arguments() as $key )
        {
            if ( !isset($model[$key]) )
            {
                throw new \RuntimeException('The required argument "'.$key.'" was not provided for '.get_called_class());
            }
        }
        
        // Assign the name of the component as the id if no id was specified
        if( !isset($model['id']) && isset($model['name']) )
        {
            $model['id'] = $model['name'];
        }

        // A name must be specified when a component has a visibility condition
        if( isset($model['show']) && !isset($model['name']) )
        {
            throw new \RuntimeException('Components with a visibility condition (a "show" argument) must have a name');
        }
        
        $this->model = array_merge( $this->default_model(), $model );
    }
675121
public function setCustomRepositoryClass($repositoryClassName)
    {
        if ($repositoryClassName && strpos($repositoryClassName, '\\') === false && strlen($this->namespace)) {
            $repositoryClassName = $this->namespace . '\\' . $repositoryClassName;
        }

        $this->customRepositoryClassName = $repositoryClassName;
    }
894909
public function setDefault(): void
	{
		$repo = $this->getRepository();
		$locales = $repo->findAll();
		foreach ($locales as $locale) {
			/* @var $locale self */
			$locale->default = false;
			$repo->persist($locale);
		}
		$this->default = true;
		$repo->persist($this);
		$repo->flush();
	}
809273
public function setModel(Model $model, $capsule)
    {
        $this->_model = $model;
        $this->_capsule = $capsule;

        return $this;
    }
919865
public function setModel(Model $model)
    {
        if (strpos($this->originalName, '.') !== false) {
            $parts = explode('.', $this->originalName);
            $name = array_pop($parts);

            while ($parts) {
                $part = array_shift($parts);
                $relation = $model->getAttribute($part);

                if ($relation instanceof Model) {
                    $model = $relation;
                    $this->setName($name);
                }
            }
        }

        return parent::setModel($model);
    }