createRoot

@return  boolean
@throws \Exception
971260
public function createRoot()
    {
        $record = new Record($this->table);

        $key = $this->getKeyName();

        $record->parent_id = 0;
        $record->lft = 0;
        $record->rgt = 1;
        $record->level = 0;
        $record->title = 'root';
        $record->alias = 'root';
        $record->access = 1;

        $record->store();

        static::$rootId = $record->$key;

        return true;
    }
844991
public function create()
    {
        $instance = self::createBraintreeGateway($this);
        $this->setId($instance->getId());
        return $instance;
    }
789434
public function create()
	{
		try
		{
			$this->client->send(new Request($this->uri->withPath($this->uri->getPath().'resources')
				->withQuery(http_build_query([
					'path' => $this->getPath()
				], null, '&')), 'PUT'));
			$this->setContents([]);
		}
		catch (\Exception $exc)
		{
			throw $exc;
		}

		return $this;
	}
1187949
private function makeRoot()
    {
        $this->lft = 1;
        $this->rgt = 2;
        $this->level = 1;
        $this->root = $this->getMaxRoot();

        return $this;
    }
347264
public function create()
    {
        $instance = self::createAddress($this);
        $this->setId($instance->getId());
        return $instance;
    }
1286645
public function create()
    {
        if ($this->getIsNewRecord() == false) {
            throw new \RuntimeException('Calling "' . __CLASS__ . '::' . __METHOD__ . '" on existing user');
        }

        $transaction = $this->getDb()->beginTransaction();

        try {
            $this->password = ($this->password == null && $this->module->enableGeneratingPassword) ? Password::generate(8) : $this->password;

            $this->trigger(self::BEFORE_CREATE);

            if (!$this->save()) {
                $transaction->rollBack();
                return false;
            }

            $this->confirm();

            $this->mailer->sendWelcomeMessage($this, null, true);
            $this->trigger(self::AFTER_CREATE);

            $transaction->commit();

            return true;
        } catch (\Exception $e) {
            $transaction->rollBack();
            \Yii::warning($e->getMessage());
            throw $e;
        }
    }
947159
public function getRoot() {
        $objWebClient = $this->getWebClient();

        $strUri = $this->getApiUrl() . '/';
        $arrHeaders = $this->getHeaders();

        $objRequest = $objWebClient->get($strUri, $arrHeaders);

        $this->objResponse = $objRequest->send();
        $strResponse = $this->objResponse->getBody(TRUE);

        return $strResponse;
    }
452009
public function buildTree()
    {
        if (null === $this->root) {
            throw new \RuntimeException('The configuration tree has no root node.');
        }
        if (null !== $this->tree) {
            return $this->tree;
        }

        return $this->tree = $this->root->getNode(true);
    }
1283507
public function init()
    {
        //strip the / off the end to check for existence of a file
        //that has the same name as $this->dir
        if (!file_exists(substr($this->dir, 0, -1)) && is_writable(dirname($this->dir))) {
            mkdir($this->dir, 0777);
        } elseif (!is_dir($this->dir)) {
            throw new \Exception("'$this->dir' is not a directory");
        } elseif (!is_writable($this->dir)) {
            throw new \Exception("'$this->dir' is not writable");
        }

        return $this;
    }
529543
public function create() {
		$ssoServer = new \Flowpack\SingleSignOn\Server\Domain\Model\SsoServer();
		if ((string)$this->serverServiceBaseUri === '') {
			throw new Exception('Missing Flowpack.SingleSignOn.Server.server.serviceBaseUri setting', 1354805519);
		}
		$ssoServer->setServiceBaseUri($this->serverServiceBaseUri);
		if ((string)$this->serverKeyPairFingerprint === '') {
			throw new Exception('Missing Flowpack.SingleSignOn.Server.server.keyPairFingerprint setting', 1351699834);
		}
		$ssoServer->setKeyPairFingerprint($this->serverKeyPairFingerprint);
		return $ssoServer;
	}
1295277
public function getRoot() {

		$parentTable = CoreTables::getTableName( CoreTables::TABLE_CATEGORY );

		return $this->hasOne( Category::class, [ 'id' => 'rootId' ] )->from( "$parentTable as root" );
	}
1071708
public function buildTree()
    {
        $this->assertTreeHasRootNode();
        if (null !== $this->tree) {
            return $this->tree;
        }

        return $this->tree = $this->root->getNode(true);
    }
60223
public function create()
    {
        if ($this->rootPath === null) {
            throw new \LogicException('Root path must be set before PathResolver can be created');
        }

        return new PathResolver($this->rootPath, $this->paths);
    }
839704
public function create()
    {
        $this->assertPathIsSet();
        $this->assertNotExists();
        $this->doCreate();
        $this->setPermissions();

        return $this;
    }
3761
public function create()
    {
        $instance = self::createDiscountPromotion($this);
        $this->setId($instance->getId());
        return $instance;
    }
1354811
public function create()
    {
        $folder = $this->getBackupFolder();

        $files = $this->backupFiles($folder);
        $db = $this->backupDatabase($folder);

        $resultFilename = $this->getBackupFilename();
        $archiveFile = dirname($folder) . DIRECTORY_SEPARATOR . $resultFilename . '.tar';

        // Create new archive
        $archive = new \PharData($archiveFile);

        // add folder
        $archive->buildFromDirectory($folder);

        // Remove temp directory
        FileHelper::removeDirectory($folder);

        return $archiveFile;
    }
1074539
public function createRoot(array $attributes)
    {
        $attributes[$this->getParentIdName()] = null;
        $root = parent::create($attributes);

        if (!$root[$this->getRootIdName()]) {
            $root[$this->getRootIdName()] = $root->getId();
            $root->save();
        }

        return $root;

    }