// Get a new instance for personal data
$blockInstance = WebBlockHelper::createWebBlockHelper($this, 'company_data');
-// Get the user instance
-$userInstance = Registry::getRegistry()->getInstance('user');
-
-// Get a shipping company instance ready
-$companyInstance = ObjectFactory::createObjectByConfiguredName('company_class', array($userInstance));
+// Set the data source instance
+$blockInstance->prefetchValueInstance('company', 'user');
+
+// Assign the company name
+if ($blockInstance->getValueInstance()->ifUserIsFounder()) {
+ // User is the founder of the company
+ $blockInstance->assignMessageField('company_stats', "user_is_company_founder");
+ $blockInstance->assignLinkFieldWithAction('company_link' , "company_overview");
+} elseif ($blockInstance->getValueInstance()->ifUserIsOwner()) {
+ // User owns the company
+ $blockInstance->assignMessageField('company_stats', "user_is_company_owner");
+ $blockInstance->assignLinkFieldWithAction('company_link' , "company_overview");
+} elseif ($blockInstance->getValueInstance()->ifUserIsEmployee()) {
+ // User is employed in company
+ $blockInstance->assignMessageField('company_stats', "user_is_employed_in_company");
+ $blockInstance->assignLinkFieldWithAction('company_link' , "employee_overview");
+} else {
+ // No company participation!
+ $blockInstance->assignMessageField('company_stats', "user_not_assigned_company");
+ $blockInstance->assignLinkFieldWithAction('company_link' , "found_new_company");
+}
// Flush the content out to a template variable
-//$blockInstance->flushContent();
+$blockInstance->flushContent();
// End of all PHP commands
?>