public function __construct($key = null) { if (is_object($key) && isset($key->post_type)) { if ($key->post_type != 'wpt_test') { $this->values['ID'] = null; return; } $postAsArray = (array) $key; unset($postAsArray['ancestors']); unset($postAsArray['filter']); unset($postAsArray['format_content']); return parent::__construct(new ArrayIterator(array($postAsArray))); } return parent::__construct($key); }
/** * Sets the value for respondent id * * @param integer $respondentId * @return WpTesting_Model_Passing */ public function setRespondentId($respondentId) { if (empty($respondentId)) { $respondentId = null; } return parent::set('respondent_id', $respondentId); }