Skip to content

Instantly share code, notes, and snippets.

@maruTA-bis5
Last active August 29, 2015 14:05
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Register Profile module service for XOOPS Cube ServiceManager
@@ -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
<?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