=========================================================================
435162
public function init ()
	{
		parent::init();

		\Craft::setAlias(
			'simplemapimages',
			__DIR__ . '/web/assets/imgs'
		);

		$this->setComponents([
			'map' => MapService::class,
		]);

		Event::on(
			Fields::class,
			Fields::EVENT_REGISTER_FIELD_TYPES,
			[$this, 'onRegisterFieldTypes']
		);

		Event::on(
			CraftVariable::class,
			CraftVariable::EVENT_INIT,
			[$this, 'onRegisterVariable']
		);

		/** @noinspection PhpUndefinedNamespaceInspection */
		/** @noinspection PhpUndefinedClassInspection */
		if (class_exists(\markhuot\CraftQL\CraftQL::class))
		{
			Event::on(
				MapField::class,
				'craftQlGetFieldSchema',
				[new GetCraftQLSchema, 'handle']
			);
		}
	}
1051183
public function init()
    {
        $this->createTableSQLCollector->init();
        $this->dropTableSQLCollector->init();
        $this->alterTableSQLCollector->init();

        $this->dropSequenceQueries = array();
        $this->dropViewQueries = array();
        $this->createViewQueries = array();
        $this->createSequenceQueries = array();
        $this->renameSchemaQueries = array();
    }
928537
private function _initialize()
    {
        $params = $this->getParameters();
        if ($params !== null) {
            for ($i = 0, $_i = count($params); $i < $_i; $i++) {
                if (self::FUNCTION_KEY == $params[$i]->getName()) {
                    $this->function = (string) $params[$i]->getValue();
                    break;
                }
            }
        }
    }
647781
public function init()
    {
        $valid = null;

        if ($this->cache->has(self::CACHE_KEY)) {
            $cached = $this->cache->get(self::CACHE_KEY);
            $valid  = $cached && isset($cached['hosts']) && count($cached['hosts']);
        }


        if ($valid) {
            $this->map = $cached;
        } else {
            $this->build();
        }
    }
951827
public void put_property(Database database, String name, DbDatum[] properties)
            throws DevFailed {
        if (!database.isAccess_checked()) checkAccess(database);

        String[] array = dbdatum2StringArray(name, properties);
        DeviceData argIn = new DeviceData();
        argIn.insert(array);
        command_inout(database, "DbPutProperty", argIn);
    }
279031
@Override
    public void (final int timeout, final boolean fwd) throws DevFailed {
	synchronized (this) {
	    final Iterator it = elements.iterator();
	    while (it.hasNext()) {
		final GroupElement e = (GroupElement) it.next();
		if (e instanceof GroupDeviceElement || fwd) {
		    e.(timeout, fwd);
		}
	    }
	}
    }
202967
@Override
    public void exportDevices() throws DevFailed {
        // load server class
        for (final Entry<String, Class<?>> entry : tangoClasses.entrySet()) {
            final String tangoClass = entry.getKey();
            final Class<?> deviceClass = entry.getValue();
            logger.debug("loading class {}", deviceClass.getCanonicalName());
            final DeviceClassBuilder deviceClassBuilder = new DeviceClassBuilder(deviceClass, tangoClass);
            deviceClassList.add(deviceClassBuilder);
            // export all its devices
            final String[] deviceList = DatabaseFactory.getDatabase().getDeviceList(serverName, tangoClass);
            logger.debug("devices found  {}", Arrays.toString(deviceList));
            // if (deviceList.length == 0) {
            // throw DevFailedUtils.newDevFailed(ExceptionMessages.DB_ACCESS, "No device defined in database for class "
            // + tangoClass);
            // }
            for (final String deviceName : deviceList) {
                buildDevice(deviceName, deviceClassBuilder);
            }
        }
    }
29630
public void putDevicePipeProperty(Database database, String deviceName, DbPipe dbPipe) throws DevFailed {
        DeviceData argIn = new DeviceData();
        String[]    array = ApiUtil.toStringArray(deviceName, dbPipe);
        argIn.insert(array);
        database.command_inout("DbPutDevicePipeProperty", argIn);
    }
97386
public function init()
    {
        if (!$this->getQuery()) {
            throw new \RuntimeException('Uninitialized QueryBuilder');
        }

        $this->resetIterator();
        $this->setNbResults($this->computeNbResult());

        if (0 == $this->getPage() || 0 == $this->getMaxPerPage() || 0 == $this->getNbResults()) {
            $this->setLastPage(0);
            $this->getQuery()->setFirstResult(0);
            $this->getQuery()->setMaxResults(0);
        } else {
            $offset = ($this->getPage() - 1) * $this->getMaxPerPage();
            $this->setLastPage(ceil($this->getNbResults() / $this->getMaxPerPage()));
            $this->getQuery()->setFirstResult($offset);
            $this->getQuery()->setMaxResults($this->getMaxPerPage());
        }
    }
775221
public function build()
    {
        if (!$this->blockname || $this->blockname==='vitals') {
            $this->distro();
            $this->hostname();
            $this->kernel();
            $this->_users();
            $this->loadavg();
        }
        if (!$this->blockname || $this->blockname==='hardware') {
            $this->cpuinfo();
            $this->pci();
            $this->ide();
            $this->scsi();
            $this->usb();
        }
        if (!$this->blockname || $this->blockname==='memory') {
            $this->memory();
        }
        if (!$this->blockname || $this->blockname==='filesystem') {
            $this->filesystems();
        }
    }
832681
public function init()
    {
        if (true === $this->beforeInit()) {
            HasPropertiesEvent::on(HasProperties::class, HasProperties::EVENT_AFTER_SAVE, [$this, 'onSave']);
            HasPropertiesEvent::on(HasProperties::class, HasProperties::EVENT_AFTER_UPDATE, [$this, 'onUpdate']);
            HasPropertiesEvent::on(HasProperties::class, HasProperties::EVENT_BEFORE_DELETE, [$this, 'onDelete']);
        }
    }
152362
public function update()
    {
        if (!$this->exists()) {
            throw new \RuntimeException('Cannot update a table that doesn\'t exist!');
        }

        // update table
        foreach ($this->getPendingColumns() as $column) {
            $this->getAdapter()->addColumn($this, $column);
        }

        foreach ($this->getIndexes() as $index) {
            $this->getAdapter()->addIndex($this, $index);
        }

        foreach ($this->getForeignKeys() as $foreignKey) {
            $this->getAdapter()->addForeignKey($this, $foreignKey);
        }

        $this->saveData();
        $this->reset(); // reset pending changes
    }
277510
public function create()
    {
        $autoIncrementField = $this->getAutoIncrementField();
        if ($autoIncrementField && $this->$autoIncrementField === null) {
            $this->$autoIncrementField = $this->getNextAutoIncrementId();
        }

        $fields = $this->getFields();
        foreach ($this->getAutoFilledData(self::OP_CREATE) as $field => $value) {
            /** @noinspection NotOptimalIfConditionsInspection */
            if (!in_array($field, $fields, true) || $this->$field !== null) {
                continue;
            }
            $this->$field = $value;
        }

        $this->validate($fields);

        $this->eventsManager->fireEvent('model:beforeSave', $this);
        $this->eventsManager->fireEvent('model:beforeCreate', $this);

        $fieldValues = [];
        $defaultValueFields = [];
        foreach ($fields as $field) {
            if ($this->$field !== null) {
                $fieldValues[$field] = $this->$field;
            } elseif ($field !== $autoIncrementField) {
                $defaultValueFields[] = $field;
            }
        }

        foreach ($this->getJsonFields() as $field) {
            if (is_array($this->$field)) {
                $fieldValues[$field] = json_encode($this->$field, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
            }
        }

        /**
         * @var \ManaPHP\DbInterface $connection
         */
        $connection = $this->_di->getShared($this->getDb($this));

        if ($autoIncrementField && $this->$autoIncrementField === null) {
            $this->$autoIncrementField = (int)$connection->insert($this->getSource($this), $fieldValues, true);
        } else {
            $connection->insert($this->getSource($this), $fieldValues);
        }

        if ($defaultValueFields) {
            if ($r = static::query(null, $this)->select($defaultValueFields)->where($this->_getPrimaryKeyValuePairs())->fetch(true)) {
                foreach ($r[0] as $field => $value) {
                    $this->$field = $value;
                }
            }
        }

        $this->_snapshot = $this->toArray();

        $this->eventsManager->fireEvent('model:afterCreate', $this);
        $this->eventsManager->fireEvent('model:afterSave', $this);

        return $this;
    }
1259922
public void add_device(Database database, String deviceName, String classname, String serverName)
            throws DevFailed {
        if (!database.isAccess_checked()) checkAccess(database);

        DbDevInfo devinfo = new DbDevInfo(deviceName, classname, serverName);
        DeviceData argIn = new DeviceData();
        argIn.insert(devinfo.toStringArray());
        command_inout(database, "DbAddDevice", argIn);
        //System.out.println(devinfo.name + " created");
    }
1340171
public void putDevicePipeProperty(String deviceName, ArrayList<DbPipe> dbPipes) throws DevFailed {
        for (DbPipe dbPipe : dbPipes)
            databaseDAO.putDevicePipeProperty(this, deviceName, dbPipe);
    }
1000705
public void put_device_attribute_property(Database database, String deviceName, DbAttribute[] attr)
            throws DevFailed {
        if (!database.isAccess_checked()) checkAccess(database);

        DeviceData argIn = new DeviceData();
        try {
            //	value is an array
            argIn.insert(ApiUtil.toStringArray(deviceName, attr, 2));
            command_inout(database, "DbPutDeviceAttributeProperty2", argIn);
        } catch (DevFailed e) {
            if (e.errors[0].reason.equals("API_CommandNotFound")) {
                //	Value is just one element
                argIn.insert(ApiUtil.toStringArray(deviceName, attr, 1));
                command_inout(database, "DbPutDeviceAttributeProperty", argIn);
            } else
                throw e;
        }
    }
242138
public synchronized void initDevice() {
        MDC.setContextMap(contextMap);
        xlogger.entry();
        if (stateImpl == null) {
            stateImpl = new StateImpl(businessObject, null, null);
        }
        if (statusImpl == null) {
            statusImpl = new StatusImpl(businessObject, null, null);
        }
        if (initImpl == null) {
            buildInit(null, false);
        }
        doInit();
        try {
            pushInterfaceChangeEvent(true);
        } catch (final DevFailed e) {
            // ignore
            logger.error("error pushing event", e);
        }
        logger.debug("device init done");
        xlogger.exit();
    }