2014-10-27 23:58:48 -05:00
|
|
|
<?php
|
|
|
|
|
2014-12-13 15:11:51 -06:00
|
|
|
namespace FireflyIII\Database;
|
2014-11-12 15:37:09 -06:00
|
|
|
|
2014-12-20 08:00:53 -06:00
|
|
|
use Illuminate\Database\Eloquent\Model as Eloquent;
|
2014-12-06 05:12:55 -06:00
|
|
|
|
2014-10-27 23:58:48 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface CUD
|
2014-11-12 15:37:09 -06:00
|
|
|
*
|
2014-10-27 23:58:48 -05:00
|
|
|
* @package FireflyIII\Database
|
|
|
|
*/
|
|
|
|
interface CUD
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
2014-12-20 08:00:53 -06:00
|
|
|
* @param Eloquent $model
|
2014-10-27 23:58:48 -05:00
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
2014-12-20 08:00:53 -06:00
|
|
|
public function destroy(Eloquent $model);
|
2014-10-27 23:58:48 -05:00
|
|
|
|
|
|
|
/**
|
2014-11-12 15:37:09 -06:00
|
|
|
* @param array $data
|
2014-10-27 23:58:48 -05:00
|
|
|
*
|
2014-12-20 08:00:53 -06:00
|
|
|
* @return Eloquent
|
2014-11-12 15:37:09 -06:00
|
|
|
*/
|
|
|
|
public function store(array $data);
|
|
|
|
|
|
|
|
/**
|
2014-12-20 08:00:53 -06:00
|
|
|
* @param Eloquent $model
|
|
|
|
* @param array $data
|
2014-10-27 23:58:48 -05:00
|
|
|
*
|
2014-11-12 15:37:09 -06:00
|
|
|
* @return bool
|
2014-10-27 23:58:48 -05:00
|
|
|
*/
|
2014-12-20 08:00:53 -06:00
|
|
|
public function update(Eloquent $model, array $data);
|
2014-10-27 23:58:48 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Validates an array. Returns an array containing MessageBags
|
|
|
|
* errors/warnings/successes.
|
|
|
|
*
|
|
|
|
* @param array $model
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function validate(array $model);
|
|
|
|
|
2014-11-22 16:30:45 -06:00
|
|
|
}
|