Entity/CustomField.php
public function getName($locale = null)
    {
        if ($locale) {
          if (isset($this->name[$locale])) {
             return $this->name[$locale];
          } else {
             foreach ($this->name as $name) {
                if (!empty($name)) {
                   return $name;
                }
             }
          }
          
          return '';
          
       } else {
          return $this->name;
       };
    }
public function getName($locale = null)
    {
        if ($locale) {
          if (isset($this->name[$locale])) {
             return $this->name[$locale];
          } else {
             foreach ($this->name as $name) {
                if (!empty($name)) {
                   return $name;
                }
             }
          }
          
          return '';
          
       } else {
          return $this->name;
       };
    }
Get name

@return array