Пример #1
0
 public function __construct($timestamp)
 {
     if (SMReflection::IsInstanceOf($timestamp, 'SMDateTime')) {
         if (self::UseNativeDateTimeClass()) {
             $this->dateTime = $timestamp->GetDatetime();
         } else {
             $this->timestamp = $timestamp->GetTimestamp();
         }
     } else {
         if (self::UseNativeDateTimeClass()) {
             $this->dateTime = new DateTime($timestamp);
         } else {
             $this->timestamp = $timestamp;
         }
     }
 }
Пример #2
0
 /**
  * @return null|PageNavigator
  */
 public function GetPaginationControl()
 {
     $pageNavigators = $this->GetPageNavigator();
     if (SMReflection::ClassName($pageNavigators) == 'CompositePageNavigator') {
         /** @var CompositePageNavigator $pageNavigators */
         foreach ($pageNavigators->GetPageNavigators() as $pageNavigator) {
             if (SMReflection::ClassName($pageNavigator) == 'PageNavigator') {
                 return $pageNavigator;
             }
         }
     }
     return null;
 }
Пример #3
0
 /**
  * @return string
  */
 public function GetInputAttributes($suppressRequiredValidation = false)
 {
     $result = '';
     $validationAttr = '';
     foreach ($this->list as $validator) {
         if ($suppressRequiredValidation && SMReflection::ClassName($validator) == 'RequiredValidator') {
             continue;
         }
         StringUtils::AddStr($validationAttr, $validator->GetValidatorName(), ' ');
         StringUtils::AddStr($result, $validator->GetAdditionalAttributes(), ' ');
     }
     if (!StringUtils::IsNullOrEmpty($validationAttr)) {
         StringUtils::AddStr($result, StringUtils::Format('data-validation="%s"', $validationAttr), ' ');
     }
     return $result;
 }
 public function GetOrderable()
 {
     if (SMReflection::IsInstanceOf($this->GetInnerField(), 'CustomDatasetFieldViewColumn')) {
         return $this->GetInnerField()->GetOrderable();
     } else {
         return false;
     }
 }