Manages all models.
163955
public function actionManage() 
	{
		$model=new BannerCategory('search');
		$model->unsetAttributes();	// clear any default values
		if(Yii::app()->getRequest()->getParam('BannerCategory')) {
			$model->attributes=Yii::app()->getRequest()->getParam('BannerCategory');
		}

		$columns = $model->getGridColumn($this->gridColumnTemp());

		$this->pageTitle = Yii::t('phrase', 'Banner Categories');
		$this->pageDescription = '';
		$this->pageMeta = '';
		$this->render('admin_manage', array(
			'model'=>$model,
			'columns' => $columns,
		));
	}
109713
public function run()
    {

         //Get The Models To put In Database
        $models = collect([
                    'Post' => Post::class,
                    'Tag' => Tag::class,
                    'Category' => Category::class
                     ]);

        //Each Model Got His Attribues
        $columns = collect([
               'Post' => [
                    'title' => [
                        'required|max:150',
                        'text',
                        true,
                        null
                    ],
                    'slug' => [
                        'required|unique:posts,slug',
                        'text',
                        true,
                        null
                    ],
                    'content' => [
                        'required',
                        'rich_text_box',
                        false,
                        null
                    ],
                    'description' => [
                        'required|max:250',
                        'text_area',
                        false,
                        null
                    ],
                    'featured' => [
                        null,
                        'checkbox',
                        false,
                        null
                    ],
                    'tags' => [
                        null,
                        'tags',
                        false,
                        null
                    ],
                    'category' => [
                        'required',
                        'category',
                        false,
                        null
                    ],
                    'image' => [
                        'required|mimes:jpeg,bmp,png',
                        'image',
                        true,
                        null
                    ],
                    'status' => [
                        null,
                        'status',
                        true,
                        [
                            [
                                'value' => 'PUBLISHED',
                                'option' => 'PUBLISHED'
                            ],
                            [
                                'value' => 'PENDING',
                                'option' => 'PENDING'
                            ],
                            [
                                'value' => 'DRAFT',
                                'option' => 'DRAFT'
                            ]
                        ],
                    ]
                ],
               'Tag' => [
                    'name' => [
                        'required|max:156',
                        'text',
                        true,
                        null
                    ],
                    'slug' => [
                        'required|max:100|unique:tags,slug',
                        'string',
                        true,
                        null
                    ]
                ],
               'Category' => [
                    'name' => [
                        'required|max:156',
                        'text',
                        true,
                        null
                    ],
                    'slug' => [
                        'required|max:100|unique:categories,slug',
                        'string',
                        true,
                        null
                    ]
                ]
               ]);
      $settings = collect([
        'title' => [
            'Site Title',
            'text'
        ],
        'description' => [
            'Site Description',
            'text'
        ],
        'logo' => [
            'Site Logo',
            'image'
        ],
        'google_analytics_client_id' => [
            'Google Api Id',
            'text'
        ]
      ]);


        $this->command->info('Laramin Data Seeder');

        $this->command->info('Seed Settings');
        $settings->each(function($value,$index) {
            $this->command->info('Creating Settings for '.$index);
            Settings::create([
                    'key' => $index,
                    'display_name' => $value[0],
                    'type' => $value[1],
            ]);
        });


        $models->each(function ($model, $index) use ($columns) {
            $this->command->info('Creating Data Type to '.$index);

            $res = DataType::create([
                        'name' => $index,
                        'menu' => true,
                        'model' =>  $index,
                        'slug' => strtolower($index),
                    ]);
            $id = $res->id;
            $columns->filter(function ($item, $key) use ($index, $id) {
                return $key == $index;
            })->Flatmap(function ($item, $key) use ($id) {
                return $item;
            })->each(function ($item, $key) use ($id) {
                $this->command->info('Creating Data Info '.$key.' for '.DataType::find($id)->name);

                DataInfo::create([
                        'data_types_id' => $id,
                        'column' => $key,
                        'type' => $item[1],
                        'validation' => $item[0] == null ? NULL : json_encode($item[0]),
                        'details' => $item[3] == null ? NULL : json_encode($item[3]),
                        'display' => $item[2]
                    ]);
            });
        });
    }
666311
public function datamodelAction() {
        $this->view->models = Garp_Spawn_Model_Set::getInstance();

        $request = $this->getRequest();
        $params = $request->getParams();

        if (array_key_exists('text', $params)) {
            $this->view->textMode = true;
            $this->_helper->layout->setLayout('blank');
        } else {
            $this->_helper->layout->setLayout('datamodel-layout');
        }
    }
189432
public function actionManage() 
	{
		$setting = OmmuSettings::model()->findByPk(1);

		$model=new OmmuLanguages('search');
		$model->unsetAttributes();	// clear any default values
		if(isset($_GET['OmmuLanguages'])) {
			$model->attributes=$_GET['OmmuLanguages'];
		}

		$columns = $model->getGridColumn($this->gridColumnTemp());

		$this->pageTitle = Yii::t('phrase', 'Language Settings');
		$this->pageDescription = Yii::t('phrase', 'The layout of your social network includes hundreds of phrases of text which are stored in a language pack. SocialEngine comes with an English pack which is the default when you first install the platform. If you want to change any of these phrases on your social network, you can edit the pack below. If you want to allow users to pick from multiple languages, you can also create additional packs below. If you have multiple language packs, the pack you\'ve selected as your "default" will be the language that displays if a user has not selected any other language. Note: You can not delete the default language. To edit a language\'s details, click its name.');
		$this->pageMeta = '';
		$this->render('admin_manage', array(
			'model'=>$model,
			'columns' => $columns,
			'setting' => $setting,
		));
	}
1106651
protected function ensureModel()
    {
        Yii::trace('Model ensuring', __METHOD__);

        if ($this->multiple) {
            if (empty($this->model) || !is_array($this->model)) {
                $this->model = [$this->model];
            }
            foreach ($this->model as $model) {
                $this->ensureModelInternal($model);
            }

            return;
        }

        $this->ensureModelInternal($this->model);
    }
1286697
private void analyzeModels() {
        try {
            do {
                ExecutorService pool = Executors.newFixedThreadPool(context.getSettings().getNbThread());

                while (context.workToDo()) {
                    pool.execute(new ModelExecutor(context));
                }

                pool.shutdown();
                while (!pool.isTerminated()) {
                    pool.awaitTermination(TIMEOUT, TimeUnit.MILLISECONDS);
                }

            } while (context.workToDo());
        } catch (InterruptedException e) {
            throw new RuntimeException("Interrupted " + e.getMessage());
        }
    }
1176216
public void setModels(java.util.Collection<ModelSummary> models) {
        if (models == null) {
            this.models = null;
            return;
        }

        this.models = new java.util.ArrayList<ModelSummary>(models);
    }
841486
private void addModels(final Key<Model>[] newModels) {
    int before = leaderboard().getModelCount();
    leaderboard().addModels(newModels);
    int after = leaderboard().getModelCount();
    modelCount.addAndGet(after - before);
  }
394492
def prepare_models(self):
        
        if self.database_config:
            for model in (self.options.queue_model, self.options.error_model):
                model.database.reset(**self.database_config)
428993
protected function initModelManager()
    {
        $managerClass = $this->getModel();
        $modelManager = $this->newModelManagerInstance($this->getModel());
        if ($modelManager instanceof RecordManager) {
            $this->modelManager = $this->newModelManagerInstance($this->getModel());
        } else {
            throw new Exception(
                "invalid ModelManager name [$managerClass] 
                for controller [" . $this->getClassName() . "]"
            );
        }
    }
846993
def add_manager(model):
    
    if model._meta.abstract:
        return
    # Make all managers local for this model to fix patching parent model managers
    model._meta.local_managers = model._meta.managers

    for current_manager in model._meta.local_managers:
        prev_class = current_manager.__class__
        patch_manager_class(current_manager)
        if model._default_manager.__class__ is prev_class:
            # Normally model._default_manager is a reference to one of model's managers
            # (and would be patched by the way).
            # However, in some rare situations (mostly proxy models)
            # model._default_manager is not the same instance as one of managers, but it
            # share the same class.
            model._default_manager.__class__ = current_manager.__class__
    patch_manager_class(model._base_manager)
    model._meta.base_manager_name = 'objects'
    model._meta._expire_cache()
1292719
protected function checkModels()
    {
        $models = func_get_args();
        //
        foreach ($models as $model) {
            if (!class_exists($model)) {
                $this->ModelNotFinded($model);
            }
        }
    }
229438
def models(self):
        '''
        
        '''
        model_dict = self._build_all_dependencies()
        while True:
            model = self._get_model_without_dependencies(model_dict)
            if not model:
                break
            yield (model, self._models().get(model))
545373
def _set_seo_models(self, value):
        
        seo_models = []
        for model_name in value:
            if "." in model_name:
                app_label, model_name = model_name.split(".", 1)
                model = models.get_model(app_label, model_name)
                if model:
                    seo_models.append(model)
            else:
                app = models.get_app(model_name)
                if app:
                    seo_models.extend(models.get_models(app))
    
        self.seo_models = seo_models
736931
public function handle()
    {
        if (count($this->models) === 0) {
            return;
        }

        $this->models->first()->searchableUsing()->update($this->models);
    }
310035
public <T extends Model>  void addModels(List<T> models){
        for (T model : models) {
            add(model);
        }
    }
21519
public function handleModels(array $models)
    {
        $builder = $this->builder;

        $builder->start();

        foreach ($models as $model) {
            $languages = (array)(isset($model->sitemapLanguages) ? $model->sitemapLanguages : Yii::$app->language);

            if (count($languages) > 1) {
                // Handle separately for each language
                foreach ($languages as $language) {
                    // Swith App language to $language
                    if (isset($model->sitemapSwithLanguages) && $model->sitemapSwithLanguages) {
                        static::setLanguage($language);
                    }

                    $this->handleModel($model, $language);

                    // Restore App language
                    static::restoreLanguage();
                }
            } else {
                // Handle only one language
                $this->handleModel($model, null);
            }
        }

        $builder->finish();
    }