Initialize the table attributes, columns and validators
Relations are not initialized by this method since they are lazy loaded

@return void
@throws PropelException
163366
public function initialize()
    {
        // attributes
        $this->setName('user_role');
        $this->setPhpName('UserRole');
        $this->setClassname('Slashworks\\BackendBundle\\Model\\UserRole');
        $this->setPackage('src.Slashworks.BackendBundle.Model');
        $this->setUseIdGenerator(false);
        // columns
        $this->addForeignPrimaryKey('user_id', 'UserId', 'INTEGER' , 'user', 'id', true, null, null);
        $this->addForeignPrimaryKey('role_id', 'RoleId', 'INTEGER' , 'role', 'id', true, null, null);
        // validators
    }
1062805
private function _initialize()
    {
        $params = $this->getParameters();
        if ($params !== null) {
            for ($i = 0, $paramsCount = count($params); $i < $paramsCount; $i++) {
                if (self::TAB_LENGTH_KEY === $params[$i]->getName()) {
                    $this->tabLength = $params[$i]->getValue();
                    break;
                }
            }
        }
    }
816282
public function initialize()
    {
        $contentTypes = $this->contentTypeRepository->findAllNotDeletedInLastVersion();

        foreach ($contentTypes as $contentType) {
            $this->schemaGenerator->createMapping($contentType);
        }
    }
191543
public function initialize()
    {
        $this->initializeShortAliases();
        $this->initializeDefaultAliases();
        foreach ($this->schemaManager->getSchemaTables() as $table) {
            $this->loadMetadataForTable($table);
        }
        $this->initialized = true;
    }
397793
private function Initialize()
    {
        if (!$this->initialized)
        {
            $schema = $this->GetSchema();
            $t = $schema->Table();
            $sql = $schema->SqlBuilder();
           
            $what = $t->ToSelectList();
            $where = $sql->Equals($t->Field($schema->KeyField()), $sql->Value($this->KeyValue()));
            $select = $sql->Select(false, $what, $t, $where);
            $reader = $schema->Connection()->ExecuteQuery((string)$select);
            if ($reader->Read())
                $this->InitFromReader($reader);

            $reader->Close();
        }
    }
173747
public function initialize()
    {
        // attributes
        $this->setName('kk_trixionary_skill_version');
        $this->setPhpName('SkillVersion');
        $this->setIdentifierQuoting(true);
        $this->setClassName('\\gossi\\trixionary\\model\\SkillVersion');
        $this->setPackage('');
        $this->setUseIdGenerator(false);
        // columns
        $this->addForeignPrimaryKey('id', 'Id', 'INTEGER' , 'kk_trixionary_skill', 'id', true, null, null);
        $this->addColumn('sport_id', 'SportId', 'INTEGER', true, null, null);
        $this->addColumn('name', 'Name', 'VARCHAR', false, 255, null);
        $this->addColumn('alternative_name', 'AlternativeName', 'VARCHAR', false, 255, null);
        $this->addColumn('slug', 'Slug', 'VARCHAR', false, 255, null);
        $this->addColumn('description', 'Description', 'LONGVARCHAR', false, null, null);
        $this->addColumn('history', 'History', 'LONGVARCHAR', false, null, null);
        $this->addColumn('is_translation', 'IsTranslation', 'BOOLEAN', false, 1, false);
        $this->addColumn('is_rotation', 'IsRotation', 'BOOLEAN', false, 1, false);
        $this->addColumn('is_acyclic', 'IsAcyclic', 'BOOLEAN', false, 1, false);
        $this->addColumn('is_cyclic', 'IsCyclic', 'BOOLEAN', false, 1, false);
        $this->addColumn('longitudinal_flags', 'LongitudinalFlags', 'INTEGER', false, null, null);
        $this->addColumn('latitudinal_flags', 'LatitudinalFlags', 'INTEGER', false, null, null);
        $this->addColumn('transversal_flags', 'TransversalFlags', 'INTEGER', false, null, null);
        $this->addColumn('movement_description', 'MovementDescription', 'LONGVARCHAR', false, null, null);
        $this->addColumn('sequence_picture_url', 'SequencePictureUrl', 'VARCHAR', false, 255, null);
        $this->addColumn('variation_of_id', 'VariationOfId', 'INTEGER', false, null, null);
        $this->addColumn('start_position_id', 'StartPositionId', 'INTEGER', false, null, null);
        $this->addColumn('end_position_id', 'EndPositionId', 'INTEGER', false, null, null);
        $this->addColumn('is_composite', 'IsComposite', 'BOOLEAN', false, 1, false);
        $this->addColumn('is_multiple', 'IsMultiple', 'BOOLEAN', false, 1, false);
        $this->addColumn('multiple_of_id', 'MultipleOfId', 'INTEGER', false, null, null);
        $this->addColumn('multiplier', 'Multiplier', 'INTEGER', false, null, null);
        $this->addColumn('generation', 'Generation', 'INTEGER', false, null, null);
        $this->addColumn('importance', 'Importance', 'INTEGER', false, null, 0);
        $this->addColumn('picture_id', 'PictureId', 'INTEGER', false, null, null);
        $this->addColumn('video_id', 'VideoId', 'INTEGER', false, null, null);
        $this->addColumn('tutorial_id', 'TutorialId', 'INTEGER', false, null, null);
        $this->addColumn('kstruktur_id', 'KstrukturId', 'INTEGER', false, null, null);
        $this->addColumn('function_phase_id', 'FunctionPhaseId', 'INTEGER', false, null, null);
        $this->addColumn('object_id', 'ObjectId', 'INTEGER', false, null, null);
        $this->addPrimaryKey('version', 'Version', 'INTEGER', true, null, 0);
        $this->addColumn('version_created_at', 'VersionCreatedAt', 'TIMESTAMP', false, null, null);
        $this->addColumn('version_comment', 'VersionComment', 'VARCHAR', false, 255, null);
        $this->addColumn('variation_of_id_version', 'VariationOfIdVersion', 'INTEGER', false, null, 0);
        $this->addColumn('multiple_of_id_version', 'MultipleOfIdVersion', 'INTEGER', false, null, 0);
        $this->addColumn('kk_trixionary_skill_ids', 'KkTrixionarySkillIds', 'ARRAY', false, null, null);
        $this->addColumn('kk_trixionary_skill_versions', 'KkTrixionarySkillVersions', 'ARRAY', false, null, null);
    }
653107
protected function initColumns()
    {
        foreach ($this->columns as $i => $column) {
            $definition = array_merge([
                'class'         => $this->columnClass,
                'renderer'      => $this,
                'context'       => $this->context,
            ], $column);

            $this->addButtonOptions = (array)$this->addButtonOptions;

            if (!isset($definition['attributeOptions'])) {
                $definition['attributeOptions'] = $this->attributeOptions;
            }

            if (!isset($definition['enableError'])) {
                $definition['enableError'] = $this->enableError;
            }

            $this->columns[$i] = Yii::createObject($definition);
        }
    }
282458
protected function initTable(): void
    {
        $tableClass = class_namespace(static::class) . '\\Table';

        // check class initialization
        if (!class_exists($tableClass) || !is_subclass_of($tableClass, TableInterface::class)) {
            throw new TableNotFoundException('`Table` class is not exists or not initialized');
        }

        /**
         * @var TableInterface $tableClass
         */
        $this->setTable($tableClass::getInstance());
    }
995308
public function init()
    {

        // initialize the prepared statements
        $this->customerVarcharsStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CUSTOMER_VARCHARS));
        $this->customerVarcharByAttributeCodeAndEntityTypeIdAndAndValueStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CUSTOMER_VARCHAR_BY_ATTRIBUTE_CODE_AND_ENTITY_TYPE_ID_AND_VALUE));
    }
148934
public function init()
	{
		parent::init();
		if($this->stateTableName===null)
			throw new CException(Yii::t('yii', 'stateTableName param cannot be null.'));
		$this->db=Yii::app()->getComponent($this->dbComponent);
		if($this->db===null)
			throw new CException(Yii::t('yii', '\'{db}\' component doesn\'t exist.',array(
				'{db}'=>$this->dbComponent
			)));
		if(!($this->db instanceof CDbConnection))
			throw new CException(Yii::t ('yii', '\'{db}\' component is not a valid CDbConnection instance.',array(
				'{db}'=>$this->dbComponent
			)));
		if($this->db->schema->getTable($this->stateTableName,true)===null)
			$this->createTable();
	}
798681
public function init()
    {
        parent::init();

        $this->owner->persistence_data['use_table_prefixes'] = true;

        // If kind is not specified, figure out join type
        if (!isset($this->kind)) {
            $this->kind = $this->weak ? 'left' : 'inner';
        }

        // Our short name will be unique
        if (!$this->foreign_alias) {
            $this->foreign_alias = (isset($this->owner->table_alias) ? $this->owner->table_alias : '').$this->short_name;
        }

        $this->owner->addhook('initSelectQuery', $this);

        // Add necessary hooks
        if ($this->reverse) {
            $this->owner->addHook('afterInsert', $this);
            $this->owner->addHook('beforeUpdate', $this);
            $this->owner->addHook('beforeDelete', [$this, 'doDelete'], null, -5);
            $this->owner->addHook('afterLoad', $this);
        } else {

            // Master field indicates ID of the joined item. In the past it had to be
            // defined as a physical field in the main table. Now it is a model field
            // so you can use expressions or fields inside joined entities.
            // If string specified here does not point to an existing model field
            // a new basic field is inserted and marked hidden.
            if (is_string($this->master_field)) {
                $e = $this->owner->hasField($this->master_field);
                if (!$e) {
                    if ($this->join) {
                        $e = $this->join->addField($this->master_field, ['system' => true, 'read_only' => true]);
                    } else {
                        $e = $this->owner->addField($this->master_field, ['system' => true, 'read_only' => true]);
                    }
                    $this->master_field = $e->short_name;
                }
            }

            $this->owner->addHook('beforeInsert', $this, null, -5);
            $this->owner->addHook('beforeUpdate', $this);
            $this->owner->addHook('afterDelete', [$this, 'doDelete']);
            $this->owner->addHook('afterLoad', $this);
        }
    }
449243
protected function init()
    {
        if (empty($this->data['databaseRow']['config'])) {
            $rows = [[['colspan' => 1, 'rowspan' => 1, 'spanned' => 0, 'name' => '0x0']]];
            $colCount = 1;
            $rowCount = 1;
        } else {
            /** @var LayoutSetup $layoutSetup */
            $layoutSetup = GeneralUtility::makeInstance(LayoutSetup::class)->init(0);
            if ($this->data['tableName'] === 'tx-gridelements_backend_layout') {
                $layoutId = $this->data['databaseRow']['alias'] ?: (int)$this->data['databaseRow']['uid'];
                $layout = $layoutSetup->getLayoutSetup($layoutId);
            } else {
                $parser = GeneralUtility::makeInstance(TypoScriptParser::class);
                $parser->parse($this->data['databaseRow']['config']);
                $layout = ['config' => $parser->setup['backend_layout.']];
                if (!empty($layout['config']['rows.'])) {
                    $columns = $layoutSetup->checkAvailableColumns($layout);
                    if ($columns['allowed'] || $columns['disallowed'] || $columns['maxitems']) {
                        $layout['columns'] = $columns;
                        unset($layout['columns']['allowed']);
                        $layout['allowed'] = $columns['allowed'] ?: [];
                        $layout['disallowed'] = $columns['disallowed'] ?: [];
                        $layout['maxitems'] = $columns['maxitems'] ?: [];
                    }
                }
            }
            $rows = [];
            $colCount = $layout['config']['colCount'];
            $rowCount = $layout['config']['rowCount'];
            $dataRows = $layout['config']['rows.'];
            $spannedMatrix = [];
            for ($i = 1; $i <= $rowCount; $i++) {
                $cells = [];
                $row = array_shift($dataRows);
                $columns = $row['columns.'];
                for ($j = 1; $j <= $colCount; $j++) {
                    $cellData = [];
                    if (!$spannedMatrix[$i][$j]) {
                        if (is_array($columns) && !empty($columns)) {
                            $column = array_shift($columns);
                            if (isset($column['colspan'])) {
                                $cellData['colspan'] = (int)$column['colspan'];
                                $columnColSpan = (int)$column['colspan'];
                                if (isset($column['rowspan'])) {
                                    $columnRowSpan = (int)$column['rowspan'];
                                    for ($spanRow = 0; $spanRow < $columnRowSpan; $spanRow++) {
                                        for ($spanColumn = 0; $spanColumn < $columnColSpan; $spanColumn++) {
                                            $spannedMatrix[$i + $spanRow][$j + $spanColumn] = 1;
                                        }
                                    }
                                } else {
                                    for ($spanColumn = 0; $spanColumn < $columnColSpan; $spanColumn++) {
                                        $spannedMatrix[$i][$j + $spanColumn] = 1;
                                    }
                                }
                            } else {
                                $cellData['colspan'] = 1;
                                if (isset($column['rowspan'])) {
                                    $columnRowSpan = (int)$column['rowspan'];
                                    for ($spanRow = 0; $spanRow < $columnRowSpan; $spanRow++) {
                                        $spannedMatrix[$i + $spanRow][$j] = 1;
                                    }
                                }
                            }
                            if (isset($column['rowspan'])) {
                                $cellData['rowspan'] = (int)$column['rowspan'];
                            } else {
                                $cellData['rowspan'] = 1;
                            }
                            if (isset($column['name'])) {
                                $cellData['name'] = $column['name'];
                            }
                            if (isset($column['colPos'])) {
                                $colPos = (int)$column['colPos'];
                                $cellData['column'] = $colPos;
                                $cellData['allowed'] = [];
                                if (isset($layout['allowed'][$colPos])) {
                                    foreach ($layout['allowed'][$colPos] as $key => $valueArray) {
                                        $cellData['allowed'][$key] = implode(',', array_keys($valueArray));
                                    }
                                }
                                $cellData['disallowed'] = [];
                                if (isset($layout['disallowed'][$colPos])) {
                                    foreach ($layout['disallowed'][$colPos] as $key => $valueArray) {
                                        $cellData['disallowed'][$key] = implode(',', array_keys($valueArray));
                                    }
                                }
                                $cellData['maxitems'] = (int)$layout['maxitems'][$colPos];
                            }
                        }
                    } else {
                        $cellData = ['colspan' => 1, 'rowspan' => 1, 'spanned' => 1];
                    }
                    $cells[] = $cellData;
                }
                $rows[] = $cells;
                if (!empty($spannedMatrix[$i]) && is_array($spannedMatrix[$i])) {
                    ksort($spannedMatrix[$i]);
                }
            }
        }
        $this->rows = $rows;
        $this->colCount = (int)$colCount;
        $this->rowCount = (int)$rowCount;
    }
1258607
public function initialize()
    {
        // attributes
        $this->setName('dealer_shedules_version');
        $this->setPhpName('DealerShedulesVersion');
        $this->setClassName('\\Dealer\\Model\\DealerShedulesVersion');
        $this->setPackage('Dealer.Model');
        $this->setUseIdGenerator(false);
        // columns
        $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'dealer_shedules', 'ID', true, null, null);
        $this->addColumn('DEALER_ID', 'DealerId', 'INTEGER', true, null, null);
        $this->addColumn('DAY', 'Day', 'INTEGER', false, null, null);
        $this->addColumn('BEGIN', 'Begin', 'TIME', false, null, null);
        $this->addColumn('END', 'End', 'TIME', false, null, null);
        $this->addColumn('CLOSED', 'Closed', 'BOOLEAN', false, 1, false);
        $this->addColumn('PERIOD_BEGIN', 'PeriodBegin', 'DATE', false, null, null);
        $this->addColumn('PERIOD_END', 'PeriodEnd', 'DATE', false, null, null);
        $this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
        $this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
        $this->addPrimaryKey('VERSION', 'Version', 'INTEGER', true, null, 0);
        $this->addColumn('VERSION_CREATED_AT', 'VersionCreatedAt', 'TIMESTAMP', false, null, null);
        $this->addColumn('VERSION_CREATED_BY', 'VersionCreatedBy', 'VARCHAR', false, 100, null);
        $this->addColumn('DEALER_ID_VERSION', 'DealerIdVersion', 'INTEGER', false, null, 0);
    }
54863
protected function init() {
        $this->data['crud'] = 'r';
        $this->data['edulevel'] = self::LEVEL_PARTICIPATING;
        $this->data['objecttable'] = user_competency::TABLE;
    }
1045629
protected function initItems()
    {
        if (is_null($this->_items)) {
            // Set the element classes
            $model = $this->getModel();
            $keys  = $model->getKeys();

            foreach ($model->getItemNames() as $item) {
                if (($item == $this->receptionCodeItem) || in_array($item, $this->editItems)) {
                    continue;
                }
                if (in_array($item, $this->exhibitItems)) {
                    $model->set($item, 'elementClass', 'Exhibitor');
                } elseif (in_array($item, $this->hiddenItems)) {
                    $model->set($item, 'elementClass', 'Hidden');
                } elseif (in_array($item, $keys)) {
                    $model->set($item, 'elementClass', 'Hidden');
                } else {
                    $model->set($item, 'elementClass', 'None');
                }
            }

            $this->_items = array_merge(
                    $this->hiddenItems,
                    $this->exhibitItems,
                    array($this->receptionCodeItem),
                    $this->editItems
                    );
        }
    }
108440
public function init()
    {
        // the table model is an object list
        if (empty($this->table_model)) {
            return false;
        }

        // get a short tag based on the table name
        if (!$this->get_table_short_tag()) return false;

        $this->tpl_replacements['where_statement']    = '';
        $this->tpl_replacements['load_row_list']      = '';
        $this->tpl_replacements['trait_list']         = "\n\nuse " . $this->namespace . "Database;\n\n";
        $this->tpl_replacements['update_insert_list'] = '';

        $i     = 0;
        $count = count($this->table_model);
        // try to fit all possibilities of generated code in here
        // otherwise it would be iterated much more often
        foreach ($this->table_model as $column) {
            // to reduce the use of the strtolower function ;) just do it once
            $property_name = strtolower($column->Field);

            // get a list of properties
            $property_list_unsorted[(string)$property_name] = (string)"\t/**" . ($column->Comment ? self::STD_INTEND_PROPERTIES . " * comment: $column->Comment" : '');
            $property_list_unsorted[(string)$property_name] .= (string)($column->Extra || strtolower($column->Null) == 'no' ? self::STD_INTEND_PROPERTIES . " * Extra: $column->Extra[Not null]" : '');
            $property_list_unsorted[(string)$property_name] .= (string)" " . self::STD_INTEND_PROPERTIES . " * @var $column->Type" . ($column->Key == 'PRI' ? " [PRIMARY KEY]" : '') . self::STD_INTEND_PROPERTIES . " */" . self::STD_INTEND_PROPERTIES . "public $" . $property_name . " = " . $this->get_type_value((($column->Null == 'NO' && !$this->with_null) ? $column->Type : '')) . ";\n\n";

            if ($column->Key == 'PRI') {

                $this->primary_key[] = $column->Field;
                if (!empty($this->where_statement)) {
                    $this->tpl_replacements['where_statement'] .= (string)' AND ';
                }
                // generate generic where statement based on the primary keys
                $this->tpl_replacements['where_statement'] .= (string)"`$column->Field` = '\$this->" . $property_name . "'";
                $this->tpl_replacements['constructor_key_list'] = '';
                $this->tpl_replacements['constructor_key_list'] .= (string)"\t\t" . '$this->' . $property_name . ' = $' . $property_name . ";\n";

            }

            if ($column->Null == 'NO') {
                $this->tpl_replacements['mandatory_fields'][] = (string)$property_name;
            }

            // mysql list for the save function
            $this->tpl_replacements['update_insert_list'] .= (string)"\t\t\$sql .= (\$this->$property_name !== " . (($column->Null == 'NO' && !$this->with_null) ? $this->get_type_value($column->Type) : 'null') . ") ? \"";
            $this->tpl_replacements['update_insert_list'] .= (string)"`$column->Field`= '\" . Database_Tool::db_sanitize(stripslashes(\$this->$property_name)) . \"'";
            $this->tpl_replacements['update_insert_list'] .= (string)($count != $i + 1 ? ', "' : '"') . " : '';\n";

            // get multi keys for assignment
            if ($column->Key == 'MUL') {
                $this->key_list = (string)$column->Field;
            }
            // get multi keys for assignment
            if ($column->Key == 'UNI') {
                $this->key_list = (string)$column->Field;
            }

            // assign the SQL field list
            $this->sql_field_list[] = (string)"`$this->table_short_tag`.`$column->Field`";

            // generates the load row property assignment list
            $this->tpl_replacements['load_row_list'] .= (string)"\t\t\$this->" . strtolower($column->Field) . " = " . (($column->Null == 'NO' && !$this->with_null) ? $this->get_type_value($column->Type, true) : '') . " isset(\$row->" . $column->Field . ") ? \$row->" . $column->Field . " : " . (($column->Null == 'NO' && !$this->with_null) ? $this->get_type_value($column->Type) : 'null') . ";\n";
            $i = $i + 1;
        }
        // remove the last coma
        // add the db to the listing of the class properties
        $property_list_unsorted['db']        = (string)"\t/**" . self::STD_INTEND_PROPERTIES . " * Database object" . self::STD_INTEND_PROPERTIES . "  * @var Object" . self::STD_INTEND_PROPERTIES . " */" . self::STD_INTEND_PROPERTIES . "public \$db = null;\n\n";
        $property_list_unsorted['mandatory'] = (string)"\t/**" . self::STD_INTEND_PROPERTIES . " * list of mandatory fields " . self::STD_INTEND_PROPERTIES . "  * @var array" . self::STD_INTEND_PROPERTIES . " */" . self::STD_INTEND_PROPERTIES . "public \$mandatory_field = array('" . implode("','", $this->tpl_replacements['mandatory_fields']) . "');\n\n";
        // sort alpabetical based on the key
        ksort($property_list_unsorted);
        $this->tpl_replacements['property_list'] = implode("\n\n", $property_list_unsorted);
        unset($property_list_unsorted);

        $this->generate_primary_key_statement();

        // implode the field list
        $this->tpl_replacements['sql_field_list'] = implode(', ', $this->sql_field_list);

        $this->tpl_replacements['constructor_param_list'] = '$' . strtolower(implode("'\n\t\t* @param ', $", $this->primary_key));

        return true;
    }
440806
protected function init() {
        $this->data['crud'] = 'd';
        $this->data['edulevel'] = self::LEVEL_OTHER;
        $this->data['objecttable'] = plan::TABLE;
    }