-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathformula.php
More file actions
58 lines (51 loc) · 1 KB
/
formula.php
File metadata and controls
58 lines (51 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/**
* @package hubzero-cms
* @copyright Copyright (c) 2005-2020 The Regents of the University of California.
* @license http://opensource.org/licenses/MIT MIT
*/
namespace Components\Wiki\Models;
use Hubzero\Database\Relational;
/**
* Model for wiki math conversions
*/
class Formula extends Relational
{
/**
* The table namespace
*
* @var string
*/
protected $namespace = 'wiki';
/**
* Default order by for model
*
* @var string
*/
public $orderBy = 'id';
/**
* Default order direction for select queries
*
* @var string
*/
public $orderDir = 'asc';
/**
* Fields and their validation criteria
*
* @var array
*/
protected $rules = array(
'inputhash' => 'notempty',
'outputhash' => 'notempty'
);
/**
* Load a record by inputhash and bind to $this
*
* @param string $inputhash Hash to load
* @return object
*/
public static function oneByInputhash($inputhash)
{
return self::blank()->whereEquals('inputhash', $inputhash)->row();
}
}