File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change 15
15
16
16
use OpenLRW \OpenLRW ;
17
17
use OpenLRW \Exception \InternalServerErrorException ;
18
- use Symfony \Component \Debug \Exception \UndefinedFunctionException ;
19
18
20
19
abstract class OneRoster extends Model
21
20
{
@@ -88,15 +87,25 @@ protected static function all()
88
87
return $ results ;
89
88
}
90
89
91
- protected static function save ($ data = null )
90
+ /**
91
+ * Save a model
92
+ *
93
+ * @return mixed|null
94
+ */
95
+ public function save ()
92
96
{
93
- if ($ data === null ) {
94
- $ data = static ::toJson ();
95
- }
97
+ $ attributes = $ this ->attributes ;
96
98
$ header = self ::generateHeader ();
97
- return OpenLRW::httpPost (self ::PREFIX . static ::$ collection , $ header , $ data );
99
+ return OpenLRW::httpPost (self ::PREFIX . static ::$ collection , $ this -> attributes , $ header );
98
100
}
99
101
102
+ /**
103
+ * Update a model
104
+ *
105
+ * @param $id
106
+ * @param $data
107
+ * @return mixed|null
108
+ */
100
109
protected static function update ($ id , $ data )
101
110
{
102
111
$ header = self ::generateHeader ();
You can’t perform that action at this time.
0 commit comments