for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class CMSPageAddController_Products extends CMSPageAddController
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
private static $url_segment = 'addproductorproductgroup';
$url_segment
This check marks private properties in classes that are never used. Those properties can be removed.
private static $url_rule = '/$Action/$ID/$OtherID';
$url_rule
private static $url_priority = 41;
$url_priority
private static $menu_title = 'Add Product';
$menu_title
private static $required_permission_codes = 'CMS_ACCESS_CMSMain';
$required_permission_codes
private static $allowed_actions = array(
$allowed_actions
'AddForm',
'doAdd',
'doCancel',
);
/**
* the class of the page that is the root parent for the shop.
*
* @var string
*/
private static $root_parent_class_for_adding_page = 'ProductGroupSearchPage';
$root_parent_class_for_adding_page
public function doCancel($data, $form)
return $this->redirect(singleton('ProductsAndGroupsModelAdmin')->Link());
}
* @return ArrayList
public function PageTypes()
$pageTypes = parent::PageTypes();
$result = new ArrayList();
$productClass = Object::getCustomClass('Product');
$productGroupClass = Object::getCustomClass('ProductGroup');
$acceptedClasses1 = ClassInfo::subclassesFor($productClass);
$acceptedClasses1[$productClass] = $productClass;
$acceptedClasses2 = ClassInfo::subclassesFor($productGroupClass);
$acceptedClasses2[$productGroupClass] = $productGroupClass;
$acceptedClasses = array_merge($acceptedClasses1, $acceptedClasses2);
foreach ($pageTypes as $type) {
if (in_array($type->ClassName, $acceptedClasses)) {
$result->push($type);
return $result;
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.