getGenericDataValue( 'user_id' ); } /** * @param string $value UUID * @return bool */ function setUser( $value ) { $value = TTUUID::castUUID( $value ); return $this->setGenericDataValue( 'user_id', $value ); } /** * @return bool|mixed */ function getParent() { return $this->getGenericDataValue( 'parent_id' ); } /** * @param string $value UUID * @return bool */ function setParent( $value ) { $value = TTUUID::castUUID( $value ); return $this->setGenericDataValue( 'parent_id', $value ); } /** * @return bool|mixed */ function getMessageControl() { return $this->getGenericDataValue( 'message_control_id' ); } /** * @param string $value UUID * @return bool */ function setMessageControl( $value ) { $value = TTUUID::castUUID( $value ); return $this->setGenericDataValue( 'message_control_id', $value ); } /** * @return bool */ function Validate() { // // BELOW: Validation code moved from set*() functions. // // Employee if ( $this->getUser() != TTUUID::getZeroID() ) { $ulf = TTnew( 'UserListFactory' ); /** @var UserListFactory $ulf */ $this->Validator->isResultSetWithRows( 'user', $ulf->getByID( $this->getUser() ), TTi18n::gettext( 'Invalid Employee' ) ); } // Parent if ( $this->getParent() != TTUUID::getZeroID() ) { $mslf = TTnew( 'MessageSenderListFactory' ); /** @var MessageSenderListFactory $mslf */ $this->Validator->isResultSetWithRows( 'parent', $mslf->getByID( $this->getParent() ), TTi18n::gettext( 'Parent is invalid' ) ); } // Message Control $mclf = TTnew( 'MessageControlListFactory' ); /** @var MessageControlListFactory $mclf */ $this->Validator->isResultSetWithRows( 'message_control_id', $mclf->getByID( $this->getMessageControl() ), TTi18n::gettext( 'Message Control is invalid' ) ); // // ABOVE: Validation code moved from set*() functions. // return true; } } ?>