예제 #1
0
 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);
 }
예제 #2
0
 /**
  * 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);
 }