Register Profile module service for XOOPS Cube ServiceManager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -52,6 +52,11 @@ class Profile_DefinitionsObject extends XoopsSimpleObject | |
{ | |
return $this->mFieldType->getDefault($this->get('options')); | |
} | |
+ | |
+ public function getServiceField() | |
+ { | |
+ return $this->get('type') . ' ' . $this->get('field_name'); | |
+ } | |
} | |
class Profile_DefinitionsHandler extends XoopsObjectGenericHandler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Put this file to XOOPS_ROOT_PATH/modules/profile/preload | |
class Profile_RegisterService extends XCube_ActionFilter { | |
/** | |
* @Override | |
*/ | |
public function postFilter() { | |
require_once XOOPS_MODULE_PATH.'/profile/service/ProfileService.class.php'; | |
$service = new Profile_Service(); | |
$service->prepare(); | |
$this->mRoot->mServiceManager->addService('profileService', $service); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment