code: public function getAttributeById($intId)
      {
          foreach ($this->getAttributes() as $objAttribute) {
              if ($objAttribute->get('id') === $intId) {
                  return $objAttribute;
              }
          }
          return null;
      }
docs: {@inheritdoc}