-//////////////////////////////////////
-// Assign the shipping company data //
-//////////////////////////////////////
-
-// Get a new instance for personal data
-$blockInstance = ObjectFactory::createObjectByConfiguredName('web_block_helper', array($this, 'company_data'));
-
-// 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_status', "user_is_company_founder");
- $blockInstance->assignLinkFieldWithAction('company_link' , "company_overview");
- $blockInstance->assignMessageField('company_link_text', "link_text_company_overview");
- $blockInstance->assignMessageField('company_link_title', "link_title_company_overview");
-} elseif ($blockInstance->getValueInstance()->ifUserIsOwner()) {
- // User owns the company
- $blockInstance->assignMessageField('company_status', "user_is_company_owner");
- $blockInstance->assignLinkFieldWithAction('company_link' , "company_overview");
- $blockInstance->assignMessageField('company_link_text', "link_text_company_overview");
- $blockInstance->assignMessageField('company_link_title', "link_title_company_overview");
-} elseif ($blockInstance->getValueInstance()->ifUserIsEmployee()) {
- // User is employed in company
- $blockInstance->assignMessageField('company_status', "user_is_employed_in_company");
- $blockInstance->assignLinkFieldWithAction('company_link' , "employee_overview");
- $blockInstance->assignMessageField('company_link_text', "link_text_employee_overview");
- $blockInstance->assignMessageField('company_link_title', "link_title_employee_overview");
-} else {
- // No company participation!
- $blockInstance->assignMessageField('company_status', "user_not_assigned_company");
- $blockInstance->assignLinkFieldWithAction('company_link' , "company");
- $blockInstance->assignMessageField('company_link_text', "link_text_company");
- $blockInstance->assignMessageField('company_link_title', "link_title_company");
-}
-
-// Flush the content out to a template variable
-$blockInstance->flushContent();
-