nystudio107 /
craft-recipe
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * Recipe plugin for Craft CMS 3.x |
||
| 4 | * |
||
| 5 | * A comprehensive recipe FieldType for Craft CMS that includes metric/imperial |
||
| 6 | * conversion, portion calculation, and JSON-LD microdata support |
||
| 7 | * |
||
| 8 | * @link https://nystudio107.com |
||
|
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
| 9 | * @copyright Copyright (c) 2017 nystudio107 |
||
|
0 ignored issues
–
show
|
|||
| 10 | */ |
||
|
0 ignored issues
–
show
|
|||
| 11 | |||
| 12 | namespace nystudio107\recipe\models; |
||
| 13 | |||
| 14 | use craft\base\Model; |
||
| 15 | |||
| 16 | /** |
||
|
0 ignored issues
–
show
|
|||
| 17 | * @author nystudio107 |
||
|
0 ignored issues
–
show
Content of the @author tag must be in the form "Display Name <[email protected]>"
Loading history...
|
|||
| 18 | * @package Recipe |
||
|
0 ignored issues
–
show
|
|||
| 19 | * @since 1.3.0 |
||
|
0 ignored issues
–
show
|
|||
| 20 | */ |
||
|
0 ignored issues
–
show
|
|||
| 21 | class Settings extends Model |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * An application ID for the Edamam Nutrition Analysis API. |
||
| 25 | * https://developer.edamam.com/edamam-nutrition-api |
||
| 26 | * |
||
| 27 | * @var ?string |
||
| 28 | */ |
||
| 29 | public ?string $apiApplicationId = null; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * An application key for the Edamam Nutrition Analysis API. |
||
| 33 | * https://developer.edamam.com/edamam-nutrition-api |
||
| 34 | * |
||
| 35 | * @var ?string |
||
| 36 | */ |
||
| 37 | public ?string $apiApplicationKey = null; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Returns whether the settings have API credentials. |
||
| 41 | */ |
||
|
0 ignored issues
–
show
|
|||
| 42 | public function hasApiCredentials(): bool |
||
| 43 | { |
||
| 44 | return ($this->apiApplicationId && $this->apiApplicationKey); |
||
| 45 | } |
||
| 46 | } |
||
| 47 |