[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [10291] Logistic: Deleted toArray function
From: |
Torstein |
Subject: |
[Fmsystem-commits] [10291] Logistic: Deleted toArray function |
Date: |
Mon, 22 Oct 2012 07:51:10 +0000 |
Revision: 10291
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10291
Author: vator
Date: 2012-10-22 07:51:09 +0000 (Mon, 22 Oct 2012)
Log Message:
-----------
Logistic: Deleted toArray function
Modified Paths:
--------------
trunk/logistic/inc/model/class.activity.inc.php
Modified: trunk/logistic/inc/model/class.activity.inc.php
===================================================================
--- trunk/logistic/inc/model/class.activity.inc.php 2012-10-22 07:10:58 UTC
(rev 10290)
+++ trunk/logistic/inc/model/class.activity.inc.php 2012-10-22 07:51:09 UTC
(rev 10291)
@@ -29,228 +29,212 @@
include_class('logistic', 'model', '/inc/model/');
- class logistic_activity extends logistic_model
- {
- public static $so;
+ class logistic_activity extends logistic_model
+ {
+ public static $so;
- protected $id;
- protected $name;
- protected $description;
- protected $parent_id;
- protected $project_id;
- protected $start_date;
- protected $end_date;
- protected $responsible_user_id;
- protected $create_user;
- protected $create_date;
- protected $update_user;
- protected $update_date;
+ protected $id;
+ protected $name;
+ protected $description;
+ protected $parent_id;
+ protected $project_id;
+ protected $start_date;
+ protected $end_date;
+ protected $responsible_user_id;
+ protected $create_user;
+ protected $create_date;
+ protected $update_user;
+ protected $update_date;
- protected $responsible_user_name;
+ protected $responsible_user_name;
- // Arrays
- protected $sub_activities = array();
+ // Arrays
+ protected $sub_activities = array();
+ protected $error_msg_array = array();
- /**
- * Constructor. Takes an optional ID. If a
contract is created from outside
- * the database the ID should be empty so the
database can add one according to its logic.
- *
- * @param int $id the id of this project
- */
- public function __construct(int $id = null)
- {
- $this->id = (int)$id;
- }
+ /**
+ * Constructor. Takes an optional ID. If a contract is created
from outside
+ * the database the ID should be empty so the database can add
one according to its logic.
+ *
+ * @param int $id the id of this project
+ */
+ public function __construct(int $id = null)
+ {
+ $this->id = (int)$id;
+ }
- public function set_id($id)
- {
- $this->id = $id;
- }
+ public function set_id($id)
+ {
+ $this->id = $id;
+ }
- public function get_id()
- {
- return $this->id;
- }
+ public function get_id()
+ {
+ return $this->id;
+ }
- public function set_name($name)
- {
- $this->name = $name;
- }
+ public function set_name($name)
+ {
+ $this->name = $name;
+ }
- public function get_name()
- {
- return $this->name;
- }
+ public function get_name()
+ {
+ return $this->name;
+ }
- public function set_description($description)
- {
- $this->description = $description;
- }
+ public function set_description($description)
+ {
+ $this->description = $description;
+ }
- public function get_description()
- {
- return $this->description;
- }
+ public function get_description()
+ {
+ return $this->description;
+ }
- public function set_parent_id($parent_id)
- {
- $this->parent_id = $parent_id;
- }
+ public function set_parent_id($parent_id)
+ {
+ $this->parent_id = $parent_id;
+ }
- public function get_parent_id()
- {
- return $this->parent_id;
- }
+ public function get_parent_id()
+ {
+ return $this->parent_id;
+ }
- public function set_project_id($project_id)
- {
- $this->project_id = $project_id;
- }
+ public function set_project_id($project_id)
+ {
+ $this->project_id = $project_id;
+ }
- public function get_project_id()
- {
- return $this->project_id;
- }
+ public function get_project_id()
+ {
+ return $this->project_id;
+ }
- public function set_start_date($start_date)
- {
- $this->start_date = $start_date;
- }
+ public function set_start_date($start_date)
+ {
+ $this->start_date = $start_date;
+ }
- public function get_start_date()
- {
- return $this->start_date;
- }
+ public function get_start_date()
+ {
+ return $this->start_date;
+ }
- public function set_end_date($end_date)
- {
- $this->end_date = $end_date;
- }
+ public function set_end_date($end_date)
+ {
+ $this->end_date = $end_date;
+ }
- public function get_end_date()
- {
- return $this->end_date;
- }
+ public function get_end_date()
+ {
+ return $this->end_date;
+ }
- public function
set_responsible_user_id($responsible_user_id)
- {
- $this->responsible_user_id =
$responsible_user_id;
- }
+ public function set_responsible_user_id($responsible_user_id)
+ {
+ $this->responsible_user_id = $responsible_user_id;
+ }
- public function get_responsible_user_id()
- {
- return $this->responsible_user_id;
- }
-
- public function
set_responsible_user_name($responsible_user_name)
- {
- $this->responsible_user_name =
$responsible_user_name;
- }
+ public function get_responsible_user_id()
+ {
+ return $this->responsible_user_id;
+ }
+
+ public function
set_responsible_user_name($responsible_user_name)
+ {
+ $this->responsible_user_name = $responsible_user_name;
+ }
- public function get_responsible_user_name()
- {
- return $this->responsible_user_name;
- }
+ public function get_responsible_user_name()
+ {
+ return $this->responsible_user_name;
+ }
- public function set_update_user($update_user)
- {
- $this->update_user = $update_user;
- }
+ public function set_update_user($update_user)
+ {
+ $this->update_user = $update_user;
+ }
- public function get_update_user()
- {
- return $this->update_user;
- }
+ public function get_update_user()
+ {
+ return $this->update_user;
+ }
- public function set_update_date($date)
- {
- $this->update_date = $date;
- }
+ public function set_update_date($date)
+ {
+ $this->update_date = $date;
+ }
- public function get_update_date()
- {
- return $this->update_date;
- }
-
- public function set_create_user($create_user)
- {
- $this->create_user = $create_user;
- }
+ public function get_update_date()
+ {
+ return $this->update_date;
+ }
+
+ public function set_create_user($create_user)
+ {
+ $this->create_user = $create_user;
+ }
- public function get_create_user()
- {
- return $this->create_user;
- }
+ public function get_create_user()
+ {
+ return $this->create_user;
+ }
- public function set_create_date($create_date)
- {
- $this->create_date = $create_date;
- }
+ public function set_create_date($create_date)
+ {
+ $this->create_date = $create_date;
+ }
- public function get_create_date()
- {
- return $this->create_date;
- }
-
- public function
set_sub_activities($sub_activities)
- {
- $this->sub_activities = $sub_activities;
- }
-
- public function get_sub_activities()
- {
- return $this->sub_activities;
- }
+ public function get_create_date()
+ {
+ return $this->create_date;
+ }
+
+ public function set_sub_activities($sub_activities)
+ {
+ $this->sub_activities = $sub_activities;
+ }
+
+ public function get_sub_activities()
+ {
+ return $this->sub_activities;
+ }
- /**
- * Get a static reference to the storage object
associated with this model object
- *
- * @return the storage object
- */
- public static function get_so()
- {
- if (self::$so == null) {
- self::$so =
CreateObject('logistic.soactivity');
- }
+ /**
+ * Get a static reference to the storage object associated with
this model object
+ *
+ * @return the storage object
+ */
+ public static function get_so()
+ {
+ if (self::$so == null) {
+ self::$so = CreateObject('logistic.soactivity');
+ }
- return self::$so;
- }
+ return self::$so;
+ }
- public function serialize()
- {
- $date_format =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
- $project_name =
$this->get_so()->get_project_name($this->get_project_id());
- $responsible_user =
$this->get_so()->get_responsible_user($this->get_responsible_user_id());
+ public function serialize()
+ {
+ $date_format =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+ $project_name =
$this->get_so()->get_project_name($this->get_project_id());
+ $responsible_user =
$this->get_so()->get_responsible_user($this->get_responsible_user_id());
- return array(
- 'id' => $this->get_id(),
- 'parent_id' =>
$this->get_parent_id(),
- 'name' => $this->get_name(),
- 'description' =>
$this->get_description(),
- 'project_id' =>
$this->get_project_id(),
- 'project_name' => $project_name,
- 'start_date' =>
$this->get_start_date() ? date($date_format, $this->get_start_date()): '',
- 'end_date' =>
$this->get_end_date() ? date($date_format, $this->get_end_date()): '',
- 'responsible_user_id' =>
$responsible_user
- );
- }
-
- public function toArray()
- {
- $converted_obj_array =
parent::toArray();
-
- $converted_obj_array['sub_activities']
= array();
-
- foreach($this->sub_activities as
$activitiy)
- {
- // Checks if object to be
converted is not the same as this object,
- // otherwise an eternal loop
will happen
- if($activitiy != $this)
- {
-
$converted_obj_array['sub_activities'][] = $activitiy->toArray();
- }
- }
-
- return $converted_obj_array;
- }
+ return array(
+ 'id' => $this->get_id(),
+ 'parent_id' => $this->get_parent_id(),
+ 'name' => $this->get_name(),
+ 'description' => $this->get_description(),
+ 'project_id' => $this->get_project_id(),
+ 'project_name' => $project_name,
+ 'start_date' => $this->get_start_date() ?
date($date_format, $this->get_start_date()): '',
+ 'end_date' => $this->get_end_date() ?
date($date_format, $this->get_end_date()): '',
+ 'responsible_user_id' => $responsible_user
+ );
}
+
+
+ }
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [10291] Logistic: Deleted toArray function,
Torstein <=