@param \Interpro\Core\Contracts\Ref\ARef $ref

@return bool
327736
public function exist(ARef $ref)
    {
        $family = $ref->getType()->getFamily();

        $refConsistExecutor = $this->getRefConsistExecutor($family);

        return $refConsistExecutor->exist($ref);
    }
357733
private function convertReferenceToValue($reference)
    {
        if (is_scalar($reference)) {
            return $this->convertScalarReference($reference);
        } else {
            return $this->convertObjectReference($reference);
        }
    }
358922
protected static function isFeriadoNacional($datref)
    {
       return in_array(str_pad($datref->getMonth(), 2, '0', STR_PAD_LEFT) . str_pad($datref->getDay(), 2, '0', STR_PAD_LEFT), @static::$feriados_nacionais);
    }
610678
public function decr($by = 1)
    {
        return (bool)$this->resque->getClient()->decrby($this->getKey(), $by);
    }
226617
public static function isFeriado($datref)
    {
        if (static::isPascoa($datref) ||
            static::isPaixao($datref) ||
            static::isFeriadoNacional($datref) ||
            static::isOther($datref)) {
            return true;
        } else {
            return false;
        }
    }
968220
function by(Row $foreign, $ref = null) {
		// select * from $this where $this->$referencedColumn = $me->$foreignColumn
		
		if (!($rel = $foreign->getTable()->getRelation($this->getName(), $ref))) {
			return $this->onResult(null);
		}
		
		$where = array();
		foreach ($rel as $key => $ref) {
			$where["$ref="] = $foreign->$key;
		}
		return $this->find($where);
	}
2330
public function is($model)
    {
        return ! is_null($model) &&
               $this->getKey() === $model->getKey() &&
               $this->getTable() === $model->getTable() &&
               $this->getConnectionName() === $model->getConnectionName();
    }
344813
public function ref($ref)
    {
        if (substr($ref, 0, 2) !== '#/') {
            // @todo Add support for external (http) refs?
            throw new Exception('Unsupported $ref "' . $ref . '", it should start with "#/"');
        }
        return $this->resolveRef($ref, '#/', $this, []);
    }
1170011
public function execute(ARef $ref)
    {
        $type      = $ref->getType();
        $type_name = $type->getName();

        if($type->getFamily() === $this->getFamily())
        {
            if($type->getRank() === TypeRank::BLOCK)
            {
                if($type_name === 'feedback')
                {
                    //Fbac - очищать?
                }
                else//Если удаляется одна из форм, очистить письма и получателей
                {
                    Fbmail::where('form_name', '=', $type_name)->delete();
                    Fbmailto::where('form_name', '=', $type_name)->delete();
                }
            }
            elseif($type->getRank() === TypeRank::GROUP)
            {
                //Пока нет групп подчиненных группам и перекрестных ссылок в пакете
            }
        }
        else
        {
            //Когда будут ссылки на сторонние А записи - наполнить логику здесь
        }
    }
90164
public function getByRef(ARef $ref, $asUnitMember = false)
    {
        $ownerType = $ref->getType();
        $owner_name = $ownerType->getName();
        $rank = $ownerType->getRank();

        if($rank === TypeRank::GROUP and $asUnitMember)
        {
            $selectionUnit = $this->tuner->getSelection($owner_name, 'group');

            return $this->select($selectionUnit);
        }

        $owner_id = $ref->getId();

        $key = $owner_name.'_'.$owner_id;

        if(array_key_exists($key, $this->units))
        {
            return $this->units[$key];
        }

        $collection = new MapScalarCollection($this->factory);
        $this->units[$key] = $collection;

        foreach($this->tables as $type_name => $table)
        {
            $query = DB::table($table);
            $query->where($table.'.entity_name', '=', $owner_name);
            $query->where($table.'.entity_id', '=', $owner_id);

            $result = Helpers::laravel_db_result_to_array($query->get(['entity_name', 'entity_id', 'name', 'value']));

            $this->addResultToCollection($type_name, $ownerType, $collection, $result);
        }

        return $collection;
    }
713715
public function belongsToReference($reference)
    {
        $reference = self::trimReference($reference);
        $reference = self::normalizeReference($reference);
        return stripos($this->getReferenceDotDelimited() . '.', $reference . '.') === 0;
    }
713707
public static function areEqual(&$ref1, &$ref2) : bool
    {
        if ($ref1 !== $ref2) {
            return false;
        }

        if (!self::$secret) {
            self::$secret = new \stdClass();
        }

        $tempStorage = $ref1;

        $ref1     = self::$secret;
        $areEqual = $ref1 === $ref2;

        $ref1 = $tempStorage;

        return $areEqual;
    }
704316
public function checkout($ref)
    {
        $this->clearAll();

        $what = $ref;
        if ($ref instanceof Branch) {
            $what = $ref->getName();
        } elseif ($ref instanceof TreeishInterface) {
            $what = $ref->getSha();
        }

        $this->addCommandName(self::GIT_CHECKOUT);
        $this->addCommandArgument('-q');
        $this->addCommandSubject($what);

        return $this->getCommand();
    }
143771
public function resolve($reference)
    {
        $parts = explode('?:', $reference, 2);

        for ($index = 0; $index < count($parts); $index++) {
            try {
                return $this->resolver->resolve(trim($parts[$index]));
            }
            catch (UnknownDefinitionException $exception) {
                continue;
            }
        }

        return null;
    }
339048
public function main($params, $ref)
    {
        $value = $params['value'];
        if (empty($value)) {
            return null;
        }

        if ($params['decodeAlias']) {
            return $this->alias2id($value);
        }

        return $this->id2alias($value);
    }
577625
protected boolean isPage(PRIndirectReference ref) {
        IntHashtable refs = (IntHashtable)pages2intrefs.get(ref.getReader());
        if (refs != null)
        	return refs.containsKey(ref.getNumber());
        else
        	return false;
    }
840034
private function hasIdentifier($reference)
    {
        // in case if reference is set after flush, store its identity
        $uow = $this->manager->getUnitOfWork();

        if ($this->manager instanceof PhpcrDocumentManager) {
            return $uow->contains($reference);
        } else {
            return $uow->isInIdentityMap($reference);
        }
    }