Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…tributeLabel()` to generate label values that are never used
- Loading branch information
1 parent
79c83ba
commit c8c0ea9
Showing
5 changed files
with
95 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
/** | ||
* @link https://www.yiiframework.com/ | ||
* @copyright Copyright (c) 2008 Yii Software LLC | ||
* @license https://www.yiiframework.com/license/ | ||
*/ | ||
|
||
namespace yiiunit\data\ar; | ||
|
||
/** | ||
* @property int $attr1 | ||
* @property int $attr2 | ||
*/ | ||
class NoAutoLabels extends ActiveRecord | ||
{ | ||
public function attributeLabels() | ||
{ | ||
return [ | ||
'attr1' => 'Label for attr1', | ||
]; | ||
} | ||
|
||
public function generateAttributeLabel($name) | ||
{ | ||
throw new \yii\base\InvalidArgumentException('Label not defined!'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters