/** * Check if the simple class is used for widget displaying * * @param array $column * @param \XLite\Model\AEntity $entity * * @return boolean */ protected function isClassColumnVisible(array $column, \XLite\Model\AEntity $entity) { return $column[static::COLUMN_CODE] === 'title' || parent::isClassColumnVisible($column, $entity); }
/** * Check if the simple class is used for widget displaying * * @param array $column Column * @param \XLite\Model\AEntity $entity Entity * * @return boolean */ protected function isClassColumnVisible(array $column, \XLite\Model\AEntity $entity) { // Right now admin cannot directly edit serviceName values for additional fields // and cannot change "Not required" state of "custom_state" field // TODO: refactor it return 'serviceName' !== $column[static::COLUMN_CODE] ? 'custom_state' === $entity->getServiceName() && 'required' === $column[static::COLUMN_CODE] ? false : parent::isClassColumnVisible($column, $entity) : $entity->getAdditional(); }
/** * Check if the simple class is used for widget displaying * * @param array $column Column * @param \XLite\Model\AEntity $entity Entity * * @return boolean */ protected function isClassColumnVisible(array $column, \XLite\Model\AEntity $entity) { $result = parent::isClassColumnVisible($column, $entity); switch ($column[static::COLUMN_CODE]) { case 'enabledForAdmin': $result = $result && ($entity->getAvailableForAdmin() || $entity->getEnabledForAdmin()); break; case 'enabledForCustomer': $result = $result && ($entity->getAvailableForCustomer() || $entity->getEnabledForCustomer()); break; default: break; } return $result; }
/** * Check if the simple class is used for widget displaying * * @param array $column * @param \XLite\Model\AEntity $entity * * @return boolean */ protected function isClassColumnVisible(array $column, \XLite\Model\AEntity $entity) { $result = parent::isClassColumnVisible($column, $entity); /** @var \XLite\Model\Shipping\Method $entity */ switch ($column[static::COLUMN_CODE]) { case 'deliveryTime': $result = 'offline' === $entity->getProcessor(); break; case 'handlingFee': $result = !\XLite::isFreeLicense(); break; default: break; } return $result; }