Set a custom source. Must be an object with foundRows() method.

@param mixed $source
347945
public function setSource($source)
    {
        if ($this->memorize) {
            if (isset($_GET[$this->skip_var])) {
                $this->skip = $this->memorize('skip', (int) $_GET[$this->skip_var]);
            } else {
                $this->skip = (int) $this->recall('skip');
            }
        } else {
            $this->skip = @$_GET[$this->skip_var] + 0;
        }

        // Start iterating early ($source = DSQL of model)
        if ($source instanceof SQL_Model) {
            $source = $source->_preexec();
        }

        if ($source instanceof DB_dsql) {
            $source->limit($this->ipp, $this->skip);
            $source->calcFoundRows();
            $this->source = $source;
        } elseif ($source instanceof \atk4\data\Model) {
            $this->source = $source->setLimit($this->ipp, $this->skip);
        } elseif ($source instanceof Model) {
            $this->source = $source->setLimit($this->ipp, $this->skip);
        } else {
            // NOTE: no limiting enabled for unknown data source
            $this->source = &$source;
        }
    }
1183300
private function setSource(string $newSource): void
    {
        $rawTokens = token_get_all($newSource);
        foreach ($rawTokens as $index => $rawToken) {
            $this->tokenStream[$index] = is_array($rawToken) ? $rawToken : [T_STRING, $rawToken];
        }
    }
1200280
public function addSource(string $class, string $source): SchemaBuilder
    {
        if (!$this->hasSchema($class)) {
            throw new SchemaException("Unable to add source to '{$class}', class is unknown to ORM");
        }

        $this->sources[$class] = $source;

        return $this;
    }
608856
protected function _sourceUsesSurvey($source)
    {
        switch ($source) {
            case self::APPOINTMENT_TABLE:
            case self::NO_TABLE:
            case self::RESPONDENT_TRACK_TABLE:
                return false;

            default:
                return true;
        }
    }
1312188
public function setSource( $source )
	{
		if( !file_exists( $source ) )
			throw new InvalidArgumentException( 'Image File "'.$source.'" is not existing.' );
		$size = @getimagesize( $source );
		if( !$size )
			throw new Exception( 'Source File "'.$source.'" is not a supported Image.' );
		$this->size		= $size;
		$this->source	= $source;
	}
1005849
public function copyPalette($source)
    {
        if( ! is_resource($source) )
        {
            throw new InvalidArgumentException(NULL, '[resource]');
        }

        imagepalettecopy($this->canvas, $source);
    }
84687
public function setSource($source)
    {
        if ($source instanceof DataList) {
            $this->setDataClass($source->dataClass());
        }
        
        return parent::setSource($source);
    }
1160318
public function set_source($value){
		if (is_string($value))
			$value = trim($value);
		$this->source = $value;
	}
413435
public function setSources(array $sources)
    {
        $parameters = $this
            ->configuration
            ->getParameters();
        $parameters['sources'] = $sources;

        $this
            ->configuration
            ->setParameters($parameters);
    }
159147
protected function setInvoiceSource($source)
    {
        parent::setInvoiceSource($source);
        $this->order = $this->invoiceSource->getSource();
        /** @var \VirtueMartModelOrders orderModel */
        $this->orderModel = VmModel::getModel('orders');
        /** @var \TableInvoices $invoicesTable */
        $invoicesTable = $this->orderModel->getTable('invoices');
        if ($invoice = $invoicesTable->load($this->order['details']['BT']->virtuemart_order_id, 'virtuemart_order_id')) {
            $this->shopInvoice = $invoice->getProperties();
        }

        if (!empty($this->order['details']['BT']->virtuemart_user_id)) {
            /** @var \VirtueMartModelUser $userModel */
            $userModel = VmModel::getModel('user');
            $userModel->setId($this->order['details']['BT']->virtuemart_user_id);
            $user = $userModel->getUser();

            foreach ($user->userInfo as $userInfo) {
                if ($userInfo->address_type === 'BT') {
                    $this->order['details']['BT']->tax_exemption_number = $userInfo->tax_exemption_number;
                }
            }
        }
    }
1004724
public function setSource($source)
    {
        if ($source !== null && !\Erebot\Utils::stringifiable($source)) {
            throw new \Erebot\InvalidValueException('Not a valid nickname');
        }

        $this->source = $source;
    }
110261
public function source($source = null)
    {
        $model = $this->noInitModel;
        if (!is_string($model->sourceAttribute)) {
            return $this;
        }
        if (!is_string($source)) {
            $modelClass = $this->modelClass;
            $source = $modelClass::$sourceSelf;
        }
        return $this->andWhere([$model->sourceAttribute => $source]);
    }
546757
public function prepareSource(&$source = null, $reference = false)
    {
        if (is_null($source)) {
            $raw = static::loadRawFromRequest();

            if (isset($_SERVER['CONTENT_TYPE']) && strpos($_SERVER['CONTENT_TYPE'], 'multipart/form-data') === 0) {
                static::parseFormData($raw, $this->data);
            } else {
                parse_str($raw, $this->data);
            }

            if (!is_array($this->data)) {
                $this->data = [];
            }
        } else {
            if ($reference) {
                $this->data = &$source;
            } else {
                $this->data = $source;
            }
        }
    }
640787
public function removeSource(Source $source)
    {
        if ($this->sources->contains($source)) {
            $this->sources->removeElement($source);
            $source->setItem(null);
        }

        return $this;
    }
1208790
public function setSource($source)
    {
        $array = $this->castToArray($source);

        foreach ($array as $item) {
            $this->append($item);
        }

        return $this;
    }
621320
public function load($source, array $options = []): self
    {
        $loader = $this->getLoader();
        $data = $loader->load($source, $options);

        expect_type($data, stdClass::class);

        static::mergeObjects($this, $data);

        return $this;
    }
935171
public function fillSource($source)
    {
        $ki = $this->keyIndex;
        $kn = $this->keyName;
        $index = $source->$ki;
        $name = $source->$kn;
        if ($index !== null) {
            if (!isset($this->names[$index])) {
                $message = 'Invalid index '.$this->contextKey.'#'.$index;
                throw new InvalidIndexed($message);
            }
            $newName = $this->names[$index];
            if ($name === null) {
                $source->$kn = $newName;
            } elseif ($name !== $newName) {
                $message = 'Mismatch '.$this->contextKey.'#'.$index.' and "'.$name.'"';
                throw new InvalidIndexed($message);
            }
            return true;
        } elseif ($name !== null) {
            $source->$ki = $this->add($name);
            return true;
        }
        return false;
    }