===========================================
334898
public int getType(final DeviceData deviceData) throws DevFailed {
        int type = Tango_DEV_VOID;
        boolean is_array = false;
        boolean is_struct = false;
        TypeCode tc = deviceData.getAny().type();
        TCKind kind;
        try {

            // Special case for state
            if (tc.kind().value()==TCKind._tk_enum) {
                return Tango_DEV_STATE;
            }

            // Check if struct
            if (tc.kind().value()==TCKind._tk_struct) {
                is_struct = true;
                // Get first element of struct
                tc = tc.member_type(0);
            }

            // Check if array
            if (tc.kind().value()==TCKind._tk_alias) {
                final TypeCode tc_alias = tc.content_type();
                if (tc_alias.kind().value()==TCKind._tk_sequence) {
                    final TypeCode tc_seq = tc_alias.content_type();
                    kind = tc_seq.kind();
                    is_array = true;
                } else {
                    kind = tc_alias.kind();
                }
            } else {
                kind = tc.kind();
            }

            // Set Tango type from TypeCode
            switch (kind.value()) {
                case TCKind._tk_void:
                    type = Tango_DEV_VOID;
                    break;

                case TCKind._tk_boolean:
                    if (is_array) {
                        type = Tango_DEVVAR_BOOLEANARRAY;
                    }
                    else {
                        type = Tango_DEV_BOOLEAN;
                    }
                    break;

                case TCKind._tk_char:
                case TCKind._tk_octet:
                    if (is_array) {
                        type = Tango_DEVVAR_CHARARRAY;
                    } else {
                        type = Tango_DEV_CHAR;
                    }
                    break;

                case TCKind._tk_short:
                    if (is_array) {
                        type = Tango_DEVVAR_SHORTARRAY;
                    } else {
                        type = Tango_DEV_SHORT;
                    }
                    break;

                case TCKind._tk_ushort:
                    if (is_array) {
                        type = Tango_DEVVAR_USHORTARRAY;
                    } else {
                        type = Tango_DEV_USHORT;
                    }
                    break;

                case TCKind._tk_long:
                    if (is_struct) {
                        type = Tango_DEVVAR_LONGSTRINGARRAY;
                    } else if (is_array) {
                        type = Tango_DEVVAR_LONGARRAY;
                    } else {
                        type = Tango_DEV_LONG;
                    }
                    break;

                case TCKind._tk_ulong:
                    if (is_array) {
                        type = Tango_DEVVAR_ULONGARRAY;
                    } else {
                        type = Tango_DEV_ULONG;
                    }
                    break;

                case TCKind._tk_longlong:
                    if (is_array) {
                        type = Tango_DEVVAR_LONG64ARRAY;
                    } else {
                        type = Tango_DEV_LONG64;
                    }
                    break;

                case TCKind._tk_ulonglong:
                    if (is_array) {
                        type = Tango_DEVVAR_ULONG64ARRAY;
                    } else {
                        type = Tango_DEV_ULONG64;
                    }
                    break;

                case TCKind._tk_float:
                    if (is_array) {
                        type = Tango_DEVVAR_FLOATARRAY;
                    } else {
                        type = Tango_DEV_FLOAT;
                    }
                    break;

                case TCKind._tk_double:
                    if (is_struct) {
                        type = Tango_DEVVAR_DOUBLESTRINGARRAY;
                    } else if (is_array) {
                        type = Tango_DEVVAR_DOUBLEARRAY;
                    } else {
                        type = Tango_DEV_DOUBLE;
                    }
                    break;

                case TCKind._tk_string:
                    if (is_array) {
                        type = Tango_DEVVAR_STRINGARRAY;
                    } else {
                        type = Tango_DEV_STRING;
                    }
                    break;
            }
        } catch (final org.omg.CORBA.TypeCodePackage.BadKind e) {
            // e.printStackTrace();
            Except.throw_exception("Api_TypeCodePackage.BadKind", "Bad or unknown type ",
                    "DeviceAttribute.getType()");
        } catch (final org.omg.CORBA.TypeCodePackage.Bounds e) {
            Except.throw_exception("Api_TypeCodePackage.BadKind", "Bad or unknown type ",
                    "DeviceAttribute.getType()");
        }
        return type;
    }
476781
@Override
    int command_inout_asynch_i(final String c, final boolean fgt, final boolean fwd, final int rid) throws DevFailed {
	synchronized (this) {
	    final Iterator it = elements.iterator();
	    while (it.hasNext()) {
		final GroupElement e = (GroupElement) it.next();
		if (e instanceof GroupDeviceElement || fwd) {
		    e.command_inout_asynch_i(c, fgt, fwd, rid);
		}
	    }
	    return rid;
	}
    }
701641
public void init(final Connection connection, final String devname, final String param,
	    	final int src) throws DevFailed {
		connection.devname = devname;
		connection.setDevice_is_dbase(false);
		if (src == FROM_IOR) {
	    	connection.ior = param;
	    	connection.url = new TangoUrl();
	    	connection.url.protocol = TANGO;
		} else {
	    	Except.throw_wrong_syntax_exception(
                    "TangoApi_INVALID_ARGS", "Invalid argument", "Connection.Connection()");
		}
    }
379123
public function initialize()
    {
        $this->initializeConnections();
        $this->_table and $this->setSource($this->_table);
        $this->keepSnapshots(true);
    }
139742
@Init
    @StateMachine(endState = DeviceState.ON)
    public void init() throws DevFailed {
        xlogger.entry();
        TangoCacheManager.setPollSize(pollingThreadsPoolSize);
        // logger.debug("init admin device with quartzThreadsPoolSize = {}",
        // quartzThreadsPoolSize);
        status = "The device is ON\nThe polling is ON";
        tangoStats = TangoStats.getInstance();
        xlogger.exit();
    }
1362420
public void init(final Connection connection, final String devname) throws DevFailed {
		 connection.url = new TangoUrl(devname);
		 connection.setDevice_is_dbase(false);
		 connection.devname = connection.url.devname;

		 // Check if connection is possible
		 if (connection.url.protocol == TANGO && connection.url.use_db) {
	    	 connection.ior = get_exported_ior(connection);
		 }
    }
803308
public function validate() {
		parent::validate();

		if ($this->getId() === null) {
			throw new ValidationException("'id' can't be null", 'id', $this);
		}
		if ($this->getVersion() === null) {
			throw new ValidationException("'version' can't be null", 'version', $this);
		}
	}
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;
    }
1336043
public function commit()
  {
    if (!is_null($this->_changes)) {
      $this->_commit($this->_changes);

      $this->_changes = null;
    }
  }
1317871
public function done()
    {
        if ($this->watcher) {
            if ($this->watcher->count > 0) {
                $this->watcher->count--;
            }
            
            $this->watcher = null;
        }
    }
3823
public function init()
    {
        $this->_init();

        if ($this->id_field) {
            $this->addField($this->id_field, [
                'system'    => true,
            ]);
        }
    }
1315126
public function onBeforeWrite()
    {
        $owner = $this->owner;
        if(!$owner->ID && !$owner->SubsiteID){
            $owner->SubsiteID = Subsite::currentSubsiteID();
        }
        parent::onBeforeWrite();
    }
1340171
public void putDevicePipeProperty(String deviceName, ArrayList<DbPipe> dbPipes) throws DevFailed {
        for (DbPipe dbPipe : dbPipes)
            databaseDAO.putDevicePipeProperty(this, deviceName, dbPipe);
    }
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();
        }
    }
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);
		}
	    }
	}
    }
1026506
public function init() {

		parent::init();

		// Permission
		$this->crudPermission = CoreGlobal::PERM_USER;

		// Config
		$this->baseUrl	= '/user';
		$this->apixBase	= 'core/user';

		// Services
		$this->modelService = Yii::$app->factory->get( 'userService' );

		$this->optionService = Yii::$app->factory->get( 'optionService' );

		$this->countryService		= Yii::$app->factory->get( 'countryService' );
		$this->provinceService		= Yii::$app->factory->get( 'provinceService' );
		$this->regionService		= Yii::$app->factory->get( 'regionService' );
		$this->addressService		= Yii::$app->factory->get( 'addressService' );
		$this->modelAddressService	= Yii::$app->factory->get( 'modelAddressService' );
	}
877638
@Override
    int read_attribute_asynch_i(final String a, final boolean fwd, final int rid) throws DevFailed {
	synchronized (this) {
	    final Iterator it = elements.iterator();
	    while (it.hasNext()) {
		final GroupElement e = (GroupElement) it.next();
		if (e instanceof GroupDeviceElement || fwd) {
		    e.read_attribute_asynch_i(a, fwd, rid);
		}
	    }
	    return rid;
	}
    }