/**
  * {@inheritdoc}
  * @return bool|null|string
  */
 public function initialize()
 {
     $this->element = $this->getElement();
     $primaryKey = $this->getProperty($this->primaryKeyField, false);
     if ($primaryKey == 'Default') {
         $primaryKey = 0;
         $this->setProperty($this->primaryKeyField, 0);
     }
     if (!$primaryKey) {
         if (!$this->element) {
             return $this->modx->lexicon('element_err_ns');
         }
         return true;
     }
     return parent::initialize();
 }
 /**
  * {@inheritdoc}
  * @return bool|null|string
  */
 public function initialize()
 {
     /*
          Determine whether the transferred parameter set ID.
          If so, then the class of the current object left without changes modPropertySet
          If not, change the class of the class of the updated element.
          That is the current element $this->object as the case may be, or modPropertySet or modTemplate | modSnippet etc.
     */
     $id = (int) $this->getProperty($this->primaryKeyField);
     if (!$id) {
         $elementType = $this->getProperty('elementType');
         if (!$elementType) {
             return $this->modx->lexicon('propertysets_err_item_class_ns');
         }
         $this->classKey = $elementType;
         $id = (int) $this->getProperty('elementId');
     }
     $this->setProperty($this->primaryKeyField, $id);
     return parent::initialize();
 }