From 29db669ed79616d750ce42806d0f1a648bc0792b Mon Sep 17 00:00:00 2001 From: xamgore <xamgore@ya.ru> Date: Sat, 30 May 2015 03:24:52 +0300 Subject: [PATCH] Model Discipline implements Serializable interface --- .../application/classes/Model/Discipline.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/~dev_rating/application/classes/Model/Discipline.php b/~dev_rating/application/classes/Model/Discipline.php index 1dd010cdd..483676141 100644 --- a/~dev_rating/application/classes/Model/Discipline.php +++ b/~dev_rating/application/classes/Model/Discipline.php @@ -15,7 +15,7 @@ * @property $type string * @property $isLocked bool */ -class Model_Discipline extends Model +class Model_Discipline extends Model implements Serializable { private $data; @@ -80,6 +80,23 @@ class Model_Discipline extends Model throw new InvalidArgumentException; } + /** + * String representation of object. + * @return string the string representation of the object or null + */ + public function serialize() { + return serialize($this->data); + } + + /** + * Constructs the object + * @param string $serialized + * The string representation of the object. + * @return void + */ + public function unserialize($serialized) { + $this->data = unserialize($serialized); + } /** * @param $id int discipline id -- GitLab