Map the successfully created address book

@param string $name
@param int $id

@return null
339125
public function mapAddressBook($name, $id)
    {
        $addressBookMap = [
            'Magento_Customers' => Config::XML_PATH_CONNECTOR_CUSTOMERS_ADDRESS_BOOK_ID,
            'Magento_Subscribers' => Config::XML_PATH_CONNECTOR_SUBSCRIBERS_ADDRESS_BOOK_ID,
            'Magento_Guests' => Config::XML_PATH_CONNECTOR_GUEST_ADDRESS_BOOK_ID,
        ];

        $this->helper->saveConfigData($addressBookMap[$name], $id, 'default', 0);
        $this->helper->log('successfully connected address book : ' . $name);
    }
1290404
public function edit($id = null) {
		$country = $this->Countries->get($id);

		if ($this->Common->isPosted()) {
			$country = $this->Countries->patchEntity($country, $this->request->getData());
			if ($this->Countries->save($country)) {
				$name = $country['name'];
				$this->Flash->success(__('record edit {0} saved', h($name)));
				return $this->redirect(['action' => 'index']);
			}

			$this->Flash->error(__('record edit not saved'));
		}

		$this->set(compact('country'));
	}
29415
protected function updateAddress($id = null)
    {
        $request = $this->getCurrentRequest();
        $customer = $this->getCustomer();

        // Show address creation/edition form
        if (null === $id) {
            $form = $this->createForm(AddressType::class);
        } else {
            $address = $this->getAddressManager()->findOneBy(['id' => $id]);
            $this->checkAddress($address);

            $form = $this->createForm(AddressType::class, $address, [
                'context' => $request->query->get('context'),
            ]);
        }

        $template = 'SonataCustomerBundle:Addresses:new.html.twig';

        if ('POST' === $request->getMethod()) {
            $form->handleRequest($request);

            if ($form->isValid()) {
                $address = $form->getData();

                $customer->addAddress($address);

                $this->getCustomerManager()->save($customer);

                $this->get('session')->getFlashBag()->add('sonata_customer_success', $id ? 'address_edit_success' : 'address_add_success');

                $url = $this->get('session')->get('sonata_address_redirect', $this->generateUrl('sonata_customer_addresses'));

                return new RedirectResponse($url);
            }
        }

        return $this->render($template, [
            'form' => $form->createView(),
            'breadcrumb_context' => 'customer_address',
        ]);
    }
398777
public function getBookInfo($id)
    {
        if (empty($id)) {
            return $this->handleError('Empty book id');
        }

        $requestResult = $this->sendRequest('addressbooks/' . $id);

        return $this->handleResult($requestResult);
    }
974769
public function setRecipient($address = null, $name = null)
    {
        try {
            $address = $this->idnToAscii($address);

            parent::addAddress($address, $name);

            // copying values as original class does not allow to access recipients array
            $this->_aRecipients[] = [$address, $name];
        } catch (Exception $exception) {
        }
    }
585926
public static function setDatabaseMap($name, DatabaseMap $map)
    {
        if ($name === null) {
            $name = self::getDefaultDB();
        }
        self::$dbMaps[$name] = $map;
    }
1241762
public function run($id, $name)
    {
        /** @var \bariew\postAbstractModule\models\Item $model */
        $model = $this->controller->findModel($id);
        if ($model->deleteFile($name)) {
            Yii::$app->session->setFlash('success', Yii::t('app', 'File successfully deleted'));
        } else {
            Yii::$app->session->setFlash('error', Yii::t('app', 'File delete error'));
        }
        return $this->controller->redirect(Yii::$app->request->referrer);
    }
304856
public function addTo($address, $name = null)
    {
        $current = $this->getTo();
        $current[$address] = $name;

        return $this->setTo($current);
    }
4528
public function registerWidget($name, $location, $id)
    {
        $tab = '    ';
        $indent = str_repeat($tab, 5);

        register_sidebar([
            'name'          => $name,
            'id'            => sprintf('%s-%s', $location, $id),
            'class'         => sprintf('%s-%s', $location, $id),
            'before_widget' => sprintf('<div id="%%1$s" class="%s-widget %%2$s">', $location),
            'after_widget'  => sprintf('</div><!-- .%s-widget -->%s', $location, PHP_EOL),
            'before_title'  => sprintf('<h3 class="%s-widget-title">', $location),
            'after_title'   => '</h3>'
        ]);
    }
652509
public function createExtendedCollection($name, MkCol $mkCol)
    {
        if (!$mkCol->hasResourceType('{'.Plugin::NS_CARDDAV.'}addressbook')) {
            throw new DAV\Exception\InvalidResourceType('Unknown resourceType for this collection');
        }
        $properties = $mkCol->getRemainingValues();
        $mkCol->setRemainingResultCode(201);
        $this->carddavBackend->createAddressBook($this->principalUri, $name, $properties);
    }
873864
public function update($id, $name, $parentid = 1, $order = null)
    {
        $params = array(
                   'name'       => $name,
                   'parentid'   => $parentid,
                   'order'      => $order,
                   'id'         => $id
                );

        return $this->http->jsonPost(self::API_UPDATE, $params);
    }
551101
public function getMappingByNameAndBranch($name, $branch_id) {
    $ids = $this->queryFactory
      ->get('mapping')
      ->condition('type', self::TYPE)
      ->condition('name', $name)
      ->condition('field_branch_ct_reference', $branch_id)
      ->execute();

    if (!$ids) {
      return NULL;
    }

    $ids = reset($ids);
    return $this->storageMapping->load($ids);
  }
282252
public function edit($id, $name) {
		$params = array(
			'id' => $id,
			'name' => $name
		);
		return $this->master->call('groups/edit', $params);
	}
1088468
public function update($id = false, $hash = false, $name = false)
    {

        if ($id) {
            $this->_id = $id;
        }
        if ($hash) {
            $this->_hash = $hash;
        }
        if ($name) {
            $this->_name = $name;
        }

        $params = array(
            'id' => $this->_id,
            'hash' => $this->_hash,
            'name' => $this->_name
        );

        $this->_user->put('pylon/update', $params);
    }
683834
public function deleteAddressBookContact($addressBookId, $contactId)
    {
        //Only if there is a contact id and address book id
        if ($addressBookId && $contactId) {
            $url = $this->getApiEndpoint() . self::REST_ADDRESS_BOOKS . $addressBookId
                . '/contacts/' . $contactId;
            $this->setUrl($url)
                ->setVerb('DELETE');
            $this->execute();
            $this->helper->log(sprintf('Delete-contact %s from addressbook %s', $contactId, $addressBookId));
        }
    }
188578
public function matchLocation($name, $organizationId, $create = true)
    {
        $cacheId = __CLASS__ . '_' . __FUNCTION__;
        $matches = $this->cache->load($cacheId);

        if (! $matches) {
            $matches = array();
            $select     = $this->db->select();
            $select->from('gems__locations')
                    ->order('glo_name');

            $result = $this->db->fetchAll($select);
            foreach ($result as $row) {
                foreach (explode('|', $row['glo_match_to']) as $match) {
                    foreach (explode(':', trim($row['glo_organizations'], ':')) as $subOrg) {
                        $matches[$match][$subOrg] = $row;
                    }
                }
            }
            $this->cache->save($matches, $cacheId, array('locations'));
        }

        if (isset($matches[$name])) {
            if ($organizationId) {
                if (isset($matches[$name][$organizationId])) {
                    return $matches[$name][$organizationId];
                }
                // Not in this organization, if we create we update the record
            } else {
                // Return the first location among the organizations
                return reset($matches[$name]);
            }
        } else {
            $matches[$name] = null;
        }

        if (! $create) {
            return null;
        }

        $result = $this->addLocation($name, $organizationId, $matches[$name]);

        return $result;
    }
758302
public function renderContent($name, $id)
    {
        if ($column = $this->getColumn($name)) {
            $column->render($id);
        }
    }