todoValueDone
todoValueDone($data, $options = array())
Description:
Returns Boolean: contributed assets have been validated and optionally approved.
Options:
(array) $data - the TodoValue with 'TodoValue' as an array key or the TodoValue.id
(array) $options - not employed.
Example:
//
$todoValueDone= $this->Deals->todoValueDone($data);
// Done - Boolean
echo 'This Todo is ' . ($todoValueDone ? 'done' : 'not done') . '.';
/**
* Done - contributed assets have been validated and optionally approved.
*
*
* @params $data TodoValue
* @params $options
* @return Boolean
*/
public function todoValueDone($data, $options = array()) {
//
$return = false;
//
if (!$data) {
//
return $return;
}
//
$data = isset($data[$this->alias][$this->primaryKey]) && strlen($data[$this->alias][$this->primaryKey]) > 0
? $data[$this->alias]
: $data;
//
$tests = array();
//
$tests[] = $this->todoValueValidate($data, array('bool' => true));
//
if ($this->approvalRequired($data)) {
//
$tests[] = $this->testApproved($data);
}
//
$return = !in_array(false, $tests, true);
//
return $return;
}