code: public static function getIdByField($field, $value)
      {
          $result = self::find()->where([$field => $value])->limit(1)->one();
          return ($result) ? $result->id : null;
      }
docs: Returns the Model Id based on the field value
  @author Adeyemi Olaoye <yemi@cottacush.com>
  @param $field
  @param $value
  @return self | null