|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?php
-
-
-
-
-
-
-
-
-
-
-
- echo "<?php\n";
- ?>
-
- namespace <?= $generator->ns ?>;
-
- use Yii;
-
-
- class <?= $className ?> extends <?= '\\' . ltrim($generator->baseClass, '\\') . "\n" ?>
- {
-
-
- public static function tableName()
- {
- return '<?= $generator->generateTableName($tableName) ?>';
- }
- <?php if ($generator->db !== 'db'): ?>
-
-
-
- public static function getDb()
- {
- return Yii::$app->get('<?= $generator->db ?>');
- }
- <?php endif; ?>
-
-
-
- public function rules()
- {
- return [<?= "\n " . implode(",\n ", $rules) . "\n " ?>];
- }
-
-
-
- public function attributeLabels()
- {
- return [
- <?php foreach ($labels as $name => $label): ?>
- <?= "'$name' => " . $generator->generateString($label) . ",\n" ?>
- <?php endforeach; ?>
- ];
- }
- <?php foreach ($relations as $name => $relation): ?>
-
-
-
- public function get<?= $name ?>()
- {
- <?= $relation[0] . "\n" ?>
- }
- <?php endforeach; ?>
- }
|