| @@ 53-64 (lines=12) @@ | ||
| 50 | * @return integer|boolean |
|
| 51 | * Returns a Field ID of the created Field on success, false otherwise. |
|
| 52 | */ |
|
| 53 | public static function add(array $fields) |
|
| 54 | { |
|
| 55 | if (!isset($fields['sortorder'])) { |
|
| 56 | $fields['sortorder'] = self::fetchNextSortOrder(); |
|
| 57 | } |
|
| 58 | ||
| 59 | if (!Symphony::Database()->insert($fields, 'tbl_fields')) { |
|
| 60 | return false; |
|
| 61 | } |
|
| 62 | ||
| 63 | return Symphony::Database()->getInsertID(); |
|
| 64 | } |
|
| 65 | ||
| 66 | /** |
|
| 67 | * Work out the next available sort order for a new field |
|
| @@ 29-40 (lines=12) @@ | ||
| 26 | * @return integer|boolean |
|
| 27 | * Returns the Page ID of the created Page on success, false otherwise. |
|
| 28 | */ |
|
| 29 | public static function add(array $fields) |
|
| 30 | { |
|
| 31 | if (!isset($fields['sortorder'])) { |
|
| 32 | $fields['sortorder'] = self::fetchNextSortOrder(); |
|
| 33 | } |
|
| 34 | ||
| 35 | if (!Symphony::Database()->insert($fields, 'tbl_pages')) { |
|
| 36 | return false; |
|
| 37 | } |
|
| 38 | ||
| 39 | return Symphony::Database()->getInsertID(); |
|
| 40 | } |
|
| 41 | ||
| 42 | /** |
|
| 43 | * Work out the next available sort order for a new page |
|