Skip to content

Measures

Mathieu Nayrolles edited this page Jan 20, 2016 · 1 revision

Measures

Measures controller

In charge of

  • Loading the board (index)
  • Deleting watch and measures (softly, delete_watch, delete_measure)
  • Serve add watch from (new_watch) and to add watches (add_watch)
  • Serve the base measure (1/2) page (new_measure) and the accuracy page (2/2).
  • Compute the base measures (1/2, baseMeasure) and accuracy measures (2/2, accuracyMeasure)

Properties

$_headerData

protected mixed $_headerData = array()
  • Visibility: protected

$_bodyData

protected mixed $_bodyData = array()
  • Visibility: protected

$_footerData

protected mixed $_footerData = array()
  • Visibility: protected

$_needLoggedIn

protected mixed $_needLoggedIn = false
  • Visibility: protected

$instance

private object $instance

Reference to the CI singleton

  • Visibility: private
  • This property is static.

Methods

__construct

void CI_Controller::__construct()

Class constructor

index

mixed Measures::index()

Loads the dashboard of an user.

  • Visibility: public

constructMeasurePage

mixed|\html Measures::constructMeasurePage()

Construct the views of the measure page (board).

  • Visibility: private

add_watch

mixed Measures::add_watch()

Add a new watch for an user.

Update the bodyData variable with the status of the insert

  • Visibility: public

delete_watch

mixed Measures::delete_watch()

Delete a watch for an user

It is noteworthy that the watch model will do a soft delete here.

Update the bodyData variable with the status of the delete.

  • Visibility: public

delete_measure

mixed Measures::delete_measure()

Deletes a measure for an user.

It is noteworthy that the measure model will do a soft delete here.

Update the bodyData variable with the status of the delete.

  • Visibility: public

new_watch

mixed Measures::new_watch()

Serves the new watch form

  • Visibility: public

new_measure

mixed Measures::new_measure()

Serves the new measure form (1/2)

  • Visibility: public

new_measure_for_watch

mixed Measures::new_measure_for_watch()

Serves the new measure form (1/2) for a watch with existing measures.

  • Visibility: public

get_accuracy

mixed Measures::get_accuracy()

Serves the new accuracy form (2/2)

  • Visibility: public

getReferenceTime

mixed Measures::getReferenceTime()

getReferenceTime. Set the server time to the user session.

This must to be call by the user before accuracyMeasure or baseMeasure

  • Visibility: public

baseMeasure

boolean Measures::baseMeasure()

Save the base measure (1/2)

TODO: When this becomes doable from many endpoints (web, mobile, ...) I'll to move it to the model.

  • Visibility: public

accuracyMeasure

\Array['accuracy', Measures::accuracyMeasure()

Save the accuracy measure (2/2).

TODO: When this becomes doable from many endpoints (web, mobile, ...) I'll to move it to the model.

FIXME: userTimezone parameter isn't used. Should it ?

  • Visibility: public

expectsPost

Boolean MY_Controller::expectsPost(Array $postNames)

Convenient method to check that variables have been posted.

In addition, all the variables contained in $postNames are copied in this. So you can access it by $this->myPostVariable.

Arguments

  • $postNames Array - <p>name of the variables expected to be posted</p>

_remap

mixed MY_Controller::_remap(String $method, Array $params)

Intercepts all method call on controller in order to provide logging capabilities.

Arguments

  • $method String - <p>the method name</p>
  • $params Array - <p>An array of get parameters (segments following the method segment)</p>

get_instance

object CI_Controller::get_instance()

Get the CI singleton

  • Visibility: public
  • This method is static.
  • This method is defined by CI_Controller
Clone this wiki locally