1 <?php
2 /**
3 * Created by PhpStorm.
4
5 * Date: 21/08/2015
6 * Time: 07:58.
7 */
8 namespace Skimia\ApiFusion\Domain\Contracts;
9
10 interface ResourceServiceModelContract
11 {
12 /**
13 * Begin querying a model with eager loading.
14 *
15 * @param array|string $relations
16 * @return \Illuminate\Database\Eloquent\Builder|static
17 */
18 public static function with($relations);
19
20 /**
21 * Fill the model with an array of attributes.
22 *
23 * @param array $attributes
24 * @return $this
25 *
26 * @throws \Illuminate\Database\Eloquent\MassAssignmentException
27 */
28 public function fill(array $attributes);
29
30 /**
31 * Begin querying the model.
32 *
33 * @return \Illuminate\Database\Eloquent\Builder
34 */
35 public static function query();
36
37 /**
38 * Convert the model instance to an array.
39 *
40 * @return array
41 */
42 public function toArray();
43 }
44