Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Y
yii2-giiant
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dmstr
yii2-giiant
Commits
23a521ec
Commit
23a521ec
authored
Sep 17, 2016
by
Tobias Munk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed logic from model-extended template, see also #170
parent
efcd0999
Pipeline
#13725
passed with stages
in 1 minute and 56 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
59 deletions
+0
-59
model-extended.php
src/generators/model/default/model-extended.php
+0
-59
No files found.
src/generators/model/default/model-extended.php
View file @
23a521ec
...
...
@@ -46,63 +46,4 @@ public function behaviors()
]
);
}
public static $listBoxData;
<?php
if
(
isset
(
$translation
))
:
?>
/**
* create array for listbox
* @param boolean $forValue list hidded elements
* @return type
*/
public static function forListbox($forValue = false)
{
if (self::$listBoxData){
return self::$listBoxData;
}
$query = self::find()
->select('`
<?=
$tableName
?>
`.`
<?=
$tableSchema
->
primaryKey
[
0
]
?>
` `id`, `lang`.`
<?=
$translation
[
'fields'
][
0
]
?>
` `name`')
->leftJoin('`
<?=
$translation
[
'language_table'
]
?>
` lang ', '
<?=
$tableName
?>
.`
<?=
$tableSchema
->
primaryKey
[
0
]
?>
` = lang.
<?=
$tableName
?>
_id and lang.language = "'.Yii::$app->language.'" ')
->orderBy('`lang`.`
<?=
$translation
[
'fields'
][
0
]
?>
`');
// if (!$forValue) {
// $query->where(['hidded' => 0]);
// }
$rows = $query->asArray()->all();
return self::$listBoxData = \yii\helpers\ArrayHelper::map($rows,'id', 'name');
}
<?php
endif
;
?>
<?php
if
(
!
isset
(
$translation
))
:
?>
/**
* create array for listbox
* @param boolean $forValue list hidded elements
* @return type
*/
public static function forListbox($forValue = false)
{
if (self::$listBoxData){
return self::$listBoxData;
}
$query = self::find()
->select('`
<?=
$tableSchema
->
primaryKey
[
0
]
?>
` `id`, `name`')
//->where(['hidded' => 0])
->orderBy('`name`');
// if (!$forValue) {
// $query->where(['hidded' => 0]);
// }
$rows = $query->asArray()->all();
return self::$listBoxData = \yii\helpers\ArrayHelper::map($rows,'id', 'name');
}
<?php
endif
;
?>
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment