@param bool $withNull

@return array
495470
public function toArray($withNull = false)
    {
        $result = [];
        foreach (get_object_vars($this) as $property => $value) {
            $getter = 'get' . str_replace('_', '', $property);
            if (method_exists($this, $getter)) {
                $result[$property] = $this->{$getter}();
            } else {
                $result[$property] = $this->{$property};
            }
        }
        if ($withNull) {
            return $result;
        }

        return array_filter(
            $result, function ($value) {
            return isset($value);
        }
        );
    }
588718
public function getPossibleReturnTypes() : array
    {
        $types = [];
        if ($this->hasReturnType()) {
            $types[] = $this->getReturnType();
            if ($types[0]->allowsNull()) {
                $types[] = null;
            }
        }
        return $types;
    }
143676
public function getSearchAttributes( $withsub = true )
	{
		/** classes/catalog/manager/index/attribute/submanagers
		 * List of manager names that can be instantiated by the catalog index attribute manager
		 *
		 * Managers provide a generic interface to the underlying storage.
		 * Each manager has or can have sub-managers caring about particular
		 * aspects. Each of these sub-managers can be instantiated by its
		 * parent manager using the getSubManager() method.
		 *
		 * The search keys from sub-managers can be normally used in the
		 * manager as well. It allows you to search for items of the manager
		 * using the search keys of the sub-managers to further limit the
		 * retrieved list of items.
		 *
		 * @param array List of sub-manager names
		 * @since 2014.03
		 * @category Developer
		 */
		$path = 'classes/catalog/manager/index/attribute/submanagers';

		$list = $this->_getSearchAttributes( $this->_searchConfig, $path, array(), $withsub );
		$list += MShop_Factory::createManager( $this->_getContext(), 'product' )->getSearchAttributes( $withsub );

		return $list;
	}
341859
final public static function findBy(array $criteria, bool $withTrash = false)
    {
        $criteria = self::criteriaWithSoftDelete($criteria, $withTrash);
        $instance = static::getRepository()
            ->findOneBy($criteria);
        // use this to avoid lint error in idea
        if ($instance instanceof static) {
            return $instance;
        } else {
            return null;
        }
    }
1319637
public static function getPath($url, $withParameters = false)
    {
        $urlInfo = static::info($url);

        return $withParameters ? ArrayHelper::get($urlInfo, 'path.with_parameters', null, true) : ArrayHelper::get($urlInfo, 'path.plain', null, true);
    }
1244197
public function fresh($with = [])
    {
        if ($this->isEmpty()) {
            return new static;
        }

        $model = $this->first();

        $freshModels = $model->newQueryWithoutScopes()
            ->with(is_string($with) ? func_get_args() : $with)
            ->whereIn($model->getKeyName(), $this->modelKeys())
            ->get()
            ->getDictionary();

        return $this->map(function ($model) use ($freshModels) {
            return $model->exists && isset($freshModels[$model->getKey()])
                    ? $freshModels[$model->getKey()] : null;
        });
    }
505899
public static function fromClass(
        string $class,
        bool $withParents = false
    ): array
    {
        try {

            $class = new \ReflectionClass($class);
        }
        catch (\ReflectionException $e) {

            throw new Exception(
                "Class '{$class}' not found.",
                Exception::CLASS_NOT_FOUND
            );
        }

        $docComment = $class->getDocComment();

        if ($withParents) {

            while (1) {

                if ($class = $class->getParentClass()) {

                    if ($parentDoc = $class->getDocComment()) {

                        $docComment = $docComment === false ?
                            $parentDoc :
                            "{$parentDoc}{$docComment}";
                    }
                }
                else {

                    break;
                }
            }
        }

        unset($class);

        if ($docComment === false) {

            return [];
        }

        return Parser::parseDocComment($docComment);
    }
1116897
public function getDomain(bool $withSuffix = true)
    {
        if (!isset($this->uri['host'])) {
            return null;
        }

        $manager = new Manager(new Cache(sys_get_temp_dir() . '/publicsuffix/'), new CurlHttpClient());
        $rules = $manager->getRules();
        $domain = $rules->resolve($this->uri['host']);

        if (!$domain->isKnown()) {
            return $this->uri['host'];
        }

        if ($withSuffix) {
            return $domain->getRegistrableDomain();
        } else {
            return substr($domain->getRegistrableDomain(), 0, -strlen($domain->getPublicSuffix()) - 1);
        }
    }
854922
public function all($data = null, $with = [], $cache = false)
    {
        if (true === $with || is_int($with)) {
            $cache = $with;
            $with  = [];
        }

        return $this->parseQuery($data, $with, $cache)->select($data);
    }
1138934
public function values(bool $withDefaults = true): array
    {
        $values            = $this->_values;
        $values['version'] = $this->_version ?? null;

        if (!$withDefaults) {
            unset($values['help'], $values['version'], $values['verbosity']);
        }

        return $values;
    }
1000870
public function getIdentifiers($with_current = false)
    {
        $identifiers = [];
        foreach ($this->resources as $name => $resource) {
            if (!(!$with_current && $name === $this->config->getResourceName())) {
                /** @noinspection PhpUndefinedMethodInspection */
                $identifiers[$name . 'Id'] = $resource->getId();
            }
        }
        return $identifiers;
    }
321474
public function getBy(array $where = [], array $with = [])
    {
        $query = $this->make($with);

        $query = $this->applyWhere($query, $where);

        return $query->get();
    }
442061
public static function getChildElements($element, $withText = false)
    {
        $children = $element->childNodes;
        $returnValue = array();
        
        for ($i = 0; $i < $children->length; $i++) {
            if ($children->item($i)->nodeType === XML_ELEMENT_NODE || ($withText === true && ($children->item($i)->nodeType === XML_TEXT_NODE || $children->item($i)->nodeType === XML_CDATA_SECTION_NODE))) {
                $returnValue[] = $children->item($i);
            }
        }
        
        return $returnValue;
    }
902461
public function getVotesList ($tag = null, bool $with = true) : array
    {
        return $this->_Votes->getVotesList(VoteUtil::tagsConvert($tag), $with);
    }
1273273
public function fresh($with = [])
    {
        if (! $this->exists) {
            return;
        }

        return static::newQueryWithoutScopes()
                        ->with(is_string($with) ? func_get_args() : $with)
                        ->where($this->getKeyName(), $this->getKey())
                        ->first();
    }
791816
public function whereNull($fields)
    {
        if (!is_array($fields)) {
            $fields = [$fields];
        }

        $exp = $this->newExpr();

        foreach ($fields as $field) {
            $exp->isNull($field);
        }

        return $this->where($exp);
    }
878500
public function getDependencies($type = null)
    {
        if (empty($this->getDatabaseContainer()->getDatabase()->getDependencies())) {
            return false;
        }

        if (!empty($type)) {
            return $this->getDatabaseContainer()->getDatabase()->getDependencies()->{'get' . $type}();
        }

        $array = [];

        $hasOne = $this->getDatabaseContainer()->getDatabase()->getDependencies()->getHasOne();
        if (!empty($hasOne)) {
            $array = array_merge(
                $array,
                array_values($hasOne)
            );
        }

        $hasMany = $this->getDatabaseContainer()->getDatabase()->getDependencies()->getHasMany();
        if (!empty($hasMany)) {
            $array = array_merge(
                $array,
                array_values($hasMany)
            );
        }

        return !empty($array) ? $array : false;
    }