@param  RecordParser|callable $recordParser

@return $this
330577
public function usingParser( $recordParser )
    {
        if (is_callable( $recordParser )) {
            $this->recordParser = new CallbackRecordParser( $recordParser );

            return $this;
        }

        if (!$recordParser instanceof RecordParser) {
            throw new InvalidArgumentException( 'Parser should implement RecordParser interface' );
        }

        $this->recordParser = $recordParser;

        return $this;
    }
192152
public static function fromParser(FriendParser $parser): Friend
    {
        $instance = new self();
        $instance->url = $parser->getUrl();
        $instance->username = $parser->getName();
        $instance->imageUrl = $parser->getAvatar();
        $instance->friendsSince = $parser->getFriendsSince();
        $instance->lastOnline = $parser->getLastOnline();

        return $instance;
    }
148595
public function getParser()
    {
        if (!isset($this->parser)) {
            $this->parser = new Parser($this);
        }
        return $this->parser;
    }
1107562
public function delete(RecordInterface $record): self
    {
        $this->loadData(true);
        $this->assertValid($record);

        foreach ($this->instances as $index => $instance) {
            if ($this->match($instance, $record)) {
                //Remove from save
                unset($this->instances[$index]);
                $this->deleteInstances[] = $instance;
                break;
            }
        }

        $this->instances = array_values($this->instances);

        return $this;
    }
1067198
public function addFilter(ConditionParser $parser, string $validationRules = null)
    {
        $this->parsers[] = $parser;
        if ($validationRules !== null) {
            $rules                           = (is_object($parser->getValidationRule())) ?
                [$validationRules, $parser->getValidationRule()] : $validationRules . '|' . $parser->getValidationRule();
            $this->rules[$parser->getName()] = $rules;
        } else {
            if (!empty($parser->getValidationRule())) {
                $this->rules[$parser->getName()] = [$parser->getValidationRule()];
            }
        }
        return $this;
    }
1180225
public static function fromParser(UserProfileParser $parser): self
    {
        $instance = new self();
        $instance->username = $parser->getUsername();
        $instance->imageUrl = $parser->getImage();
        $instance->url = $parser->getUrl();

        return $instance;
    }
668481
public static function fromParser(SeasonListItemParser $parser): self
    {
        $instance = new self();
        $instance->year = $parser->getYear();
        $instance->seasons = $parser->getSeasons();

        return $instance;
    }
991175
public static function parser(ParserInterface $parser = null)
	{
		if($parser) {
			static::$parser = $parser;
		}
		elseif(!static::$parser) {
			static::$parser = new Annotation\KeyValuePairParser;
		}

		return static::$parser;
	}
1048389
public function parse(Parser $parser)
    {
        $parser->match(Lexer::T_IDENTIFIER);
        $parser->match(Lexer::T_OPEN_PARENTHESIS);

        $this->maskField = $parser->ArithmeticPrimary();
        $this->deleteDeferredPath($parser, $this->maskField);

        $parser->match(Lexer::T_COMMA);
        $this->findValue = $parser->ArithmeticPrimary();

        $parser->match(Lexer::T_CLOSE_PARENTHESIS);
        $this->parserResult = $parser->getParserResult();
    }
1043683
protected function parseRecord($record, $fields_info, $filter_info = null, $for_update = false, $old_record = null)
    {
        unset($record['Timestamp']); // not set-able

        return parent::parseRecord($record, $fields_info, $filter_info, $for_update, $old_record);
    }
1230557
public function withSelector(RecordSelector $selector): RecordSource
    {
        $source = clone $this;
        $source->setSelector($selector);

        return $source;
    }
57361
public static function fromParser(ProducerParser $parser): self
    {
        $instance = new self();
        $instance->malUrl = $parser->getUrl();
        $instance->anime = $parser->getProducerAnime();

        return $instance;
    }
534192
public static function fromParser(MangaGenreParser $parser): self
    {
        $instance = new self();
        $instance->itemCount = $parser->getCount();
        $instance->manga = $parser->getGenreManga();
        $instance->malUrl = new MalUrl(
            $parser->getName(),
            $parser->getUrl()
        );

        return $instance;
    }
594932
public function addParser(string $contentType, callable $parser): self
	{
		$this->parsers[$contentType] = \Closure::fromCallable($parser);

		return $this;
	}
346635
final public function page($pageNumber, $recordsPerPage = null)
    {
        $recordsPerPage = $recordsPerPage ?? $this->recordsPerPage;

        $this->getQuery()->limit(((int)$pageNumber) * $recordsPerPage, $recordsPerPage);
        $this->pagedQuery = true;

        return $this;
    }
1318291
public function setPaginator($paginator)
    {
        if (is_array($paginator)) {
            $paginator = new Paginator($paginator);
        }
        $this->paginator = $paginator;
        return $this;
    }
1205308
public function addRecord(\Gpupo\CommonSchema\ORM\Entity\Banking\Report\Record $record)
    {
        $this->records[] = $record;

        return $this;
    }