All methods related to setting up this object

Namely; fields and notification.
"all" stands for executing all available methods.

@param string $type

@return AbstractEdge
969217
public function setup(string $type = "all"): AbstractEdge
    {
        $fields = function(): AbstractEdge
        {
            $this->fields = Loaders\FieldsLoader::fetchArray($this);
            return $this;
        };

        $notification = function(): AbstractEdge
        {
            $is_a_notification = function(string $class_name): bool
            {
                if(!class_exists($class_name))
                    return false;
                $reflector = new \ReflectionClass($class_name);
                return $reflector->isSubclassOf(AbstractNotification::class);
            };
            $notification_class = get_class($this)."Notification";
            if($is_a_notification($notification_class)) {
                $this->notification = new $notification_class($this);
            }
            return $this;
        };

        
        $all = function() use ($fields, $notification): AbstractEdge
        {
            $fields();    
            return $notification();
        };

        if($type!="type" && in_array($type, get_defined_vars()))
            return $$type();
    }
279192
public function onCreate($type = null)
    {
        $this->onList();
        Breadcrumbs::register('notification-create', function($breadcrumbs) {
            $breadcrumbs->parent('notifications');
            $breadcrumbs->push(trans('antares/notifications::messages.notification_templates_create'));
        });
        view()->share('breadcrumbs', Breadcrumbs::render('notification-create'));
    }
1374452
public function setType($type)
    {
        $const = sprintf('%s::TYPE_%s', __CLASS__, strtoupper($type));
        
        if(defined($const))
        {
            $type = constant($const);
        }
        
        $this->setAttributeDirectly('type', $type);
        
        $this->enumerationStrategy = null;
    }
548224
public function setType($type)
    {
        if (is_string($type)) {
            $type = ColumnType::createType($type);
        } elseif (!$type instanceof AbstractType) {
            throw new Exception\InvalidArgumentException(__METHOD__ . ' setType() accepts only AbstractType or string.');
        }
        $this->properties['type'] = $type;

        return $this;
    }
227050
public function enable($type = self::TYPE_ALL)
    {
        if($type & self::TYPE_EXCEPTION && !($this->_exception_type & self::TYPE_EXCEPTION))
        {
            set_exception_handler(array($this, '_handleException'));
            $this->_exception_type |= self::TYPE_EXCEPTION;
        }

        if($type & self::TYPE_ERROR && !($this->_exception_type & self::TYPE_ERROR))
        {
            set_error_handler(array($this, '_handleError'));
            $this->_exception_type |= self::TYPE_ERROR;
        }

        if($type & self::TYPE_FAILURE && !($this->_exception_type & self::TYPE_FAILURE))
        {
            if (!$this->__shutdown_registered)
            {
                register_shutdown_function(array($this, '_handleFailure'));
                $this->__shutdown_registered = true;
            }

            $this->_exception_type |= self::TYPE_FAILURE;
        }

        return $this;
    }
435439
public function type($type = null)
    {
        if (is_null($type)) {
            unset($this->filters['post_type']);
        } else {
            $this->filters['post_type'] = $type;
        }
        return $this;
    }
234827
public function setType($type)
    {
        $types = array(
            'file',
            'script',
            'ready',
            'block',
            'var'
        );

        if (! in_array($type, $types)) {
            Throw new PageException('Javascript targets have to be "file", "script", "block", "var" or "ready"');
        }

        $this->type = $type;

        return $this;
    }
179406
private function executeTraits($type)
    {
        if (empty($this->usedTraits))
        {
            return;
        }

        switch ($type)
        {
            case 'prolog':
                $type = 'Prolog';
            break;

            case 'main':
                $type = 'Main';
            break;

            default:
                $type = 'Epilog';
            break;
        }

        foreach ($this->usedTraits as $trait => $name)
        {
            $method = 'execute'.$type.$name;

            if (method_exists($trait, $method))
            {
                $this->$method();
            }
        }
    }
853075
public function setType(Type $type = null)
    {
        if ($this->type !== $type) {
            // romove link on this item for old type
            if ($this->type instanceof Type) {
                $tmp = $this->type;
                $this->type = null;
                $tmp->removeItem($this);
            }
            $this->type = $type;
            // add link on this item
            if ($this->type instanceof Type) {
                $this->type->addItem($this);
            }
        }

        return $this;
    }
494764
private function checkForMixedType(string $type): self
    {
        if (strtolower($type) === 'mixed') {
            throw (new CodeWarning(static::CODE_MIXED_TYPE, self::MESSAGE_MIXED_TYPE, $this->stackPos))
                ->setToken($this->token);
        }

        return $this;
    }
242207
public function setType( $type )
    {
        if ( empty( static::$type ) )
        {
            $this->proxyBase->type = $type;
        }
        elseif ( static::$type != $type )
        {
            throw new LogicException( 'Cannot alter type after creation' );
        }

        return $this;
    }
314996
public function type(string $type) : self
    {
        $types = [
            'music.song',
            'music.album',
            'music.playlist',
            'music.radio_station',
            'video.movie',
            'video.episode',
            'video.tv_show',
            'video.other',
            'article',
            'book',
            'profile',
            'website',
        ];

        if ($this->validate and ! in_array($type, $types)) {
            throw new Exception("Open Graph: Invalid type '{$type}' (unknown type)");
        }

        $this->forget('type');

        $this->tags[] = $this->createTag('type', $type);

        return $this;
    }
96259
public function setType($type)
    {
        if (!self::isValidType($type)) {
            throw new \InvalidArgumentException("$type is not a valid event type");
        }

        $this->type = $type;

        return $this;
    }
292399
public function setType(?string $type): Workflow
    {
        if ($type !== null) {
            Assert::oneOf($type, self::VALID_TYPES);
        }
        $this->type = $type;

        return $this;
    }
1059047
public function setOpenGraphType($type)
    {
        if (!empty($type)) {
            Yii::$app->view->registerMetaTag(['name' => 'og:type', 'content' => $type], 'og:type');
        }
        return $this;
    }
108894
public function addType(Type $type)
    {
        if ($type instanceof self) {
            foreach ($type->getTypes() as $subType) {
                $this->types[] = $subType;
            }

            return $this;
        }

        $this->types[] = $type;

        return $this;
    }
833973
public function setType(string $type = self::TYPE_HIDDEN): InputInterface
    {
        $this->type = $type;

        return $this;
    }