public function saveData($aLinkData)
 {
     if ($this->iLinkId === null) {
         $oLink = new Link();
     } else {
         $oLink = LinkQuery::create()->findPk($this->iLinkId);
     }
     $oLink->setUrl(LinkUtil::getUrlWithProtocolIfNotSet($aLinkData['url']));
     $oLink->setName($aLinkData['name']);
     $oLink->setLinkCategoryId($aLinkData['link_category_id'] == null ? null : $aLinkData['link_category_id']);
     $oLink->setDescription($aLinkData['description']);
     if (isset($aLinkData['language_id'])) {
         $oLink->setLanguageId($aLinkData['language_id'] != null ? $aLinkData['language_id'] : null);
     }
     $this->validate($aLinkData);
     if (!Flash::noErrors()) {
         throw new ValidationException();
     }
     if ($oLink->getLinkCategoryId() != null) {
         if ($oLink->isNew() || $oLink->isColumnModified(LinkPeer::LINK_CATEGORY_ID)) {
             $oLink->setSort(LinkQuery::create()->filterByLinkCategoryId($oLink->getLinkCategoryId())->count() + 1);
         }
     }
     $oLink->save();
     return $oLink->getId();
 }