Add item ref to spine

@param string $id
@param string $liner
@param array $properties List of property. 'page-spread-left' or 'page-spread-right' is allowed.

@return mixed
486499
public function addIdref($id, $liner = 'yes', array $properties = [] ){
		$itemref = $this->dom->spine->addChild('itemref');
		$itemref['idref'] = $id;
		if( 'no' === $liner ){
			$itemref['linear'] = 'no';
		}
		if( !empty($properties) ){
			$itemref['properties'] = implode(' ', $properties);
		}
		return $itemref;
	}
783826
public function updateOrAdd(LineInterface $line)
    {
        $key = $line->key();

        $index = $this->search(function (LineInterface $line) use ($key) {
            return $line->key() == $key;
        });

        if ($index > -1) {
            $this->put($index, $line);
        } else {
            $this->add($line);
        }
    }
1325242
public function add(string $id, $entry, string $type = self::EXCLUSIVE): Entry
    {
        $this->registered[] = $id;
        return $this->container->add($id, $entry, $type);
    }
749208
public function addItem($id, $content, $title = false)
    {
        $this->tooltips[$id] = $this->newItem($id, $content, $title);
    }
140131
public function addProperty(PropertyInterface $property, PropertyInterface $before = null)
    {
        $hash = \spl_object_hash($property);

        if ($before) {
            $beforeHash = \spl_object_hash($before);

            if (!isset($this->properties[$beforeHash])) {
                throw new DcGeneralInvalidArgumentException(
                    \sprintf(
                        'Property %s not contained in legend - can not add %s after it.',
                        $before->getName(),
                        $property->getName()
                    )
                );
            }

            $hashes   = \array_keys($this->properties);
            $position = \array_search($beforeHash, $hashes);

            $this->properties = \array_merge(
                \array_slice($this->properties, 0, $position),
                [$hash => $property],
                \array_slice($this->properties, $position)
            );

            return $this;
        }

        $this->properties[$hash] = $property;

        return $this;
    }
72722
public function addAction($id)
    {
        $hub   = $this->getRepo('Profile')->find($id);
        $buyer = $this->getUser()->getCurrentProfile();

        if (!$hub)
        {
            throw $this->createNotFoundException('No hub found for id '.$id);
        }

        $buyerHubRef = $this->getRepo('BuyerHubRef')
            ->findOneByBuyerAndHub($buyer, $hub);

        if (!$buyerHubRef)
        {
            $buyerHubRef = new BuyerHubRef();
            $buyerHubRef->setHub($hub);

            $buyer->addBuyerHubRefAsBuyer($buyerHubRef);

            $em = $this->getDoctrine()->getEntityManager();
            $em->persist($buyerHubRef);
            $em->flush();
        }

        return $this->redirect($this->generateUrl('Buyer_hub_show', array(
            'id' => $hub->getId(),
        )));
    }
1333879
protected void addPropertyReferenceFromElement(String id, Element element, BeanDefinitionBuilder bean) {
        String beanElement = element.getAttribute(id);
        bean.addPropertyReference(id, beanElement);
    }
549383
public function addNoteToIssue($id, $note, $privateNote = false)
    {
        return $this->update($id, [
            'notes' => $note,
            'private_notes' => $privateNote,
        ]);
    }
874062
public function insertSingle($id, $document) {
		$request = new CPS_InsertRequest($id, $document);
		$this->_lastResponse = $this->_connection->sendRequest($request);
		return count($this->_lastResponse->getModifiedIds());
	}
920962
public function put($id, $name = null, $body = null, $guestSpaceId = null): array
    {
        $options = ['json' => ['id' => $id]];
        if ($name !== null) {
            $options['json']['name'] = $name;
        }
        if ($body !== null) {
            $options['json']['body'] = $body;
        }

        /** @var JsonStream $stream */
        $stream = $this->client
            ->put(KintoneApi::generateUrl('space/thread.json', $guestSpaceId), $options)
            ->getBody();

        return $stream->jsonSerialize();
    }
97393
protected function move($id, $parentId, $left, $right)
    {
        $instance = $this->repository->find($id);

        $attributes = $instance->getAttributes();
        $attributes[$this->getLeftColumn($instance)] = $left;
        $attributes[$this->getRightColumn($instance)] = $right;
        $attributes[$this->getParentColumn($instance)] = $parentId;

        $instance->setRawAttributes($attributes);
        $instance->save();
    }
690802
public function putGuests($id, array $guests): array
    {
        $options = ['json' => compact('id', 'guests')];

        /** @var JsonStream $stream */
        $stream = $this->client
            ->put(KintoneApi::generateUrl('space/guests.json', $id), $options)
            ->getBody();

        return $stream->jsonSerialize();
    }
207926
protected R setCollectionId(String id) {
        JsonArray jsonArray = new JsonArray();
        if (!TextUtils.isEmpty(id)) {
            BoxCollection col = BoxCollection.createFromId(id);
            jsonArray.add(col.toJsonObject());
        }
        mBodyMap.put(FIELD_COLLECTIONS, jsonArray);
        return (R) this;
    }
1315134
public function addExternal($network, $id)
	{

		if (!(int)$network)
		{
			if (!isset(self::$social[$network])) return $this;
			$network = self::$social[$network];
		}

        $this->getDbConnection()->delete('users_external', array(
                'external_type' => $network, 
                'external_id'   => $id,
        ));		
		
        $this->getDbConnection()->insert('users_external', array(
                'user_id'       => $this->id, 
                'external_type' => $network, 
                'external_id'   => $id,
        ));
			
	    $this->_external = null;
			
        return $this;  		
		
	}
582076
protected function _addRefItems( array $entry, $id )
	{
		if( isset( $entry['stock'] ) ) {
			$this->_addProductStock( $id, $entry['stock'] );
		}

		if( isset( $entry['attribute'] ) ) {
			$this->_addAttributes( $id, $entry['attribute'], 'product' );
		}

		if( isset( $entry['media'] ) ) {
			$this->_addMedia( $id, $entry['media'], 'product' );
		}

		if( isset( $entry['price'] ) ) {
			$this->_addPrices( $id, $entry['price'], 'product' );
		}

		if( isset( $entry['text'] ) ) {
			$this->_addTexts( $id, $entry['text'], 'product' );
		}

		if( isset( $entry['product'] ) ) {
			$this->_addProducts( $id, $entry['product'], 'product' );
		}
	}
371485
public function putGalleryAction($id) {
        $manager = $this->get('doctrine_phpcr.odm.default_document_manager');
        $entity = $manager->getRepository('ToguMediaBundle:Gallery')->find($id);
        if ($entity === null) {
            return $this->handleView(View::create('', 404));
        }
        $serializer = $this->get("tpg_extjs.phpcr_serializer");
        $entity = $serializer->deserialize(
            $this->getRequest()->getContent(),
            'Togu\\MediaBundle\\Document\\Gallery',
            'json',
            DeserializationContext::create()->setGroups(array("Default", "put"))
        );
        $validator = $this->get('validator', array('Default', 'put'));
        $validations = $validator->validate($entity);
        if ($validations->count() === 0) {
            try {
//                $manager->merge($entity);
                $manager->flush();
            } catch (DBALException $e) {
                return $this->handleView(
                    View::create(array('errors'=>array($e->getMessage())), 400)
                );
            }
            return $this->handleView(
                View::create(array(
                	"success" => true,
                	"records" => array($entity)
                ), 200)->setSerializationContext($this->getSerializerContext(array("get")))
            );
        } else {
            return $this->handleView(
                View::create(array('errors'=>$validations), 400)
            );
        }
    }
283045
public function resolve(Document $document, Uri $ref, $name, $depth, PropertyInterface $property = null)
    {
        $uri = $this->resolver->resolve($document->getBaseUri(), $ref);

        if (isset($this->objects[$uri->toString()])) {
            return $this->objects[$uri->toString()];
        }

        if ($property === null) {
            $property = new PropertyType();
            $property->setRef($uri->toString());
        }

        $this->objects[$uri->toString()] = $property;

        $doc  = $this->getDocument($uri, $document);
        $doc->getProperty($uri->getFragment(), $name, $depth, $property);

        return $property;
    }