1 NSN includes 30 ADR, if this year is non-leap.

@param Builder    $query
@param JewishDate $anniv
483832
private function nisanAnniversaries(Builder $query, JewishDate $anniv): void
    {
        if ($anniv->day === 1 && !$anniv->isLeapYear()) {
            $query->where(static function (Builder $query): void {
                $query->where(static function (Builder $query): void {
                    $query->where('d_day', '<=', 1)->where('d_mon', '=', 8);
                })->orWhere(static function (Builder $query): void {
                    $query->where('d_day', '=', 30)->where('d_mon', '=', 6);
                });
            });
        } else {
            $this->defaultAnniversaries($query, $anniv);
        }
    }
692110
public function apply(Builder $query, $or = false)
    {
        $field_alias = $this->field_alias;

        if(is_array($this->value))
        {
            if($or)
            {
                $query->orWhereIn($field_alias, $this->value);
            }
            else
            {
                $query->whereIn($field_alias, $this->value);
            }
        }
        else
        {
            if($or)
            {
                $query->orWhere($field_alias, '=', $this->value);
            }
            else
            {
                $query->where($field_alias, '=', $this->value);
            }
        }
    }
1326257
public function getRelationCountQuery(Builder $query, Builder $parent)
    {
        return $this->getRelationExistenceQuery($query, $parent, new Expression('count(*)'));
    }
635431
public function queryAndCount(string $query, array $params = []): int
	{
		$prepared = $this->prepare($query, $params);

		$this->execute($prepared);

		return $prepared['statement']->rowCount();
	}
1139201
public function scopeFromYearsAgo(Builder $query, $ago, $endDateTime = null)
    {
        return $this->scopeFromDateTimeRange(DateTime::getYearsAgo($ago, $endDateTime));
    }
182156
@SuppressWarnings("unchecked")
    @Override
    public <R> R query(TemporalQuery<R> query) {
        if (query == TemporalQueries.chronology()) {
            return (R) getChronology();
        } else if (query == TemporalQueries.precision()) {
            return (R) ChronoUnit.DAYS;
        } else if (query == TemporalQueries.localDate()) {
            return (R) LocalDate.ofEpochDay(toEpochDay());
        } else if (query == TemporalQueries.localTime() || query == TemporalQueries.zone() ||
                query == TemporalQueries.zoneId() || query == TemporalQueries.offset()) {
            return null;
        }
        return super.query(query);
    }
23725
public function fromSub($query, $as)
	{
		$bindings = [];
		if( $query instanceof Closure )
		{
			$callback = $query;
			$callback($query = $this->newQuery());
		}

		if( $query instanceof self )
		{
			$bindings = $query->getBindings();
			$query = $query->toSql();
		}
		else if( !is_string($query) )
		{
			throw new InvalidArgumentException;
		}

		$this->from = new Expression('('. $query .') as '.$this->grammar->wrap($as));
		$this->setBindings($bindings, 'from');

		return $this;
	}
108693
public function processInsertGetId(Builder $query, $sql, $values, $sequence = null)
    {
        $id        = 0;
        $parameter = 0;
        $statement = $this->prepareStatement($query, $sql);
        $values    = $this->incrementBySequence($values, $sequence);
        $parameter = $this->bindValues($values, $statement, $parameter);
        $statement->bindParam($parameter, $id, PDO::PARAM_INT, 10);
        $statement->execute();

        return (int) $id;
    }
1161155
public function getRelationCountQuery(Builder $query, Builder $parent)
	{
		if ($parent->getQuery()->from == $query->getQuery()->from)
		{
			return $this->getRelationCountQueryForSelfRelation($query, $parent);
		}

		return parent::getRelationCountQuery($query, $parent);
	}
97169
public function getRelationExistenceQueryForSelfRelation(Builder $query, Builder $parentQuery, $columns = ['*'])
    {
        $query->from($query->getModel()->getTable().' as '.$hash = $this->getRelationCountHash());

        $query->join($this->throughParent->getTable(), $this->getQualifiedParentKeyName(), '=', $hash.'.'.$this->secondKey);

        if ($this->throughParentSoftDeletes()) {
            $query->whereNull($this->throughParent->getQualifiedDeletedAtColumn());
        }

        $query->getModel()->setTable($hash);

        return $query->select($columns)->whereColumn(
            $parentQuery->getQuery()->from.'.'.$this->localKey, '=', $this->getQualifiedFirstKeyName()
        );
    }
838810
public function getRelationExistenceQueryForSelfRelation(Builder $query, Builder $parentQuery, $columns = ['*'])
    {
        $query->select($columns)->from(
            $query->getModel()->getTable().' as '.$hash = $this->getRelationCountHash()
        );

        $query->getModel()->setTable($hash);

        return $query->whereColumn(
            $hash.'.'.$this->ownerKey, '=', $this->getQualifiedForeignKeyName()
        );
    }
311126
public function scopePublishedAt(Builder $query, $year)
    {
        return $this->scopePublished($query)
                    ->where(DB::raw('YEAR(published_at)'), $year);
    }
669275
public function visit($query, NodeContract $node, string $context)
    {
        if ($node instanceof Nodes\KeyNode) {
            $key = $node->getValue();

            $keys = explode('.', $key);

            if (count($keys) === 1) {
                $keys = [$this->getBaseTable(), $keys[0]];
            }

            $key = implode('.', $keys);

            $node->setValue($key);

            if ($this->getKeys()[0] === '*') {
                return;
            }

            if (!in_array($key, $this->getKeys())) {
                throw new QuerySyntaxException();
            }
        }

        foreach ($node->getChildren() as $child) {
            $this->visit($query, $child, $context);
        }
    }
76109
protected function queryAddPrimaryKeyWhere($query, $id, $clause = 'where')
	{
		$table = $query->quoteIdent($this->table_alias ? $this->table_alias : $this->table);

		if ($id === null || $id === array() || $id === false || $id === '') {
			throw new InvalidArgumentException('Empty ID.');
		} else if (count($id) != count($this->describeId())) {
			throw new InvalidArgumentException(sprintf('Malformed ID: got %d pieces of %d.', count($id), count($this->describeId())));
		}
		foreach (array_combine($this->describeId(), (array) $id) as $col => $val) {
			$query->$clause($table.'.'.$query->quoteIdent($col).' = ?', $val);
		}
		return $query;
	}
55463
protected function setKeysForSaveQuery(Builder $query)
    {
        $query->where($this->foreignKey, $this->getAttribute($this->foreignKey));

        return $query->where($this->otherKey, $this->getAttribute($this->otherKey));
    }
1179885
public function apply(Builder $query, $or = false)
    {
        $field_alias = $this->field_alias;

        if(is_array($this->value))
        {
            if($or)
            {
                $query->orWhereNotIn($field_alias, $this->value);
            }
            else
            {
                $query->whereNotIn($field_alias, $this->value);
            }
        }
        else
        {
            if($or)
            {
                $query->orWhere($field_alias, '!=', $this->value);
            }
            else
            {
                $query->where($field_alias, '!=', $this->value);
            }
        }
    }
1316480
public function getRelationExistenceCountQuery(Builder $query, Builder $parentQuery)
    {
        return $this->getRelationExistenceQuery(
            $query, $parentQuery, new Expression('count(*)')
        );
    }