Sulu\Bundle\ContactBundle\Contact\AbstractContactManager::processUrls PHP Méthode

processUrls() public méthode

Process all urls of request.
public processUrls ( $contact, array $urls ) : boolean
$contact The contact to be processed
$urls array
Résultat boolean True if the processing was successful, otherwise false
    public function processUrls($contact, $urls)
    {
        $get = function ($url) {
            return $url->getId();
        };
        $delete = function ($url) use($contact) {
            return $contact->removeUrl($url);
        };
        $update = function ($url, $matchedEntry) {
            return $this->updateUrl($url, $matchedEntry);
        };
        $add = function ($url) use($contact) {
            return $this->addUrl($contact, $url);
        };
        $entities = $contact->getUrls();
        $result = $this->processSubEntities($entities, $urls, $get, $add, $update, $delete);
        $this->resetIndexOfSubentites($entities);
        // check main
        $this->setMainUrl($contact);
        return $result;
    }