2017 © Pedro PelΓ‘ez
 

library feed-yml

ΠΎΠ±Ρ€Π°Π±ΠΎΡ‚Ρ‡ΠΈΠΊ Π»Π΅Π½Ρ‚Ρ‹ YML

image

masterflash-ru/feed-yml

ΠΎΠ±Ρ€Π°Π±ΠΎΡ‚Ρ‡ΠΈΠΊ Π»Π΅Π½Ρ‚Ρ‹ YML

  • Friday, May 18, 2018
  • by masterflash-ru
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

ΠΎΠ±Ρ€Π°Π±ΠΎΡ‚Ρ‡ΠΈΠΊ Π»Π΅Π½Ρ‚Ρ‹ YML

Π‘Ρ‚Π°Ρ€Ρ‚ Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠΈ, (*1)

ΠŸΡ€ΠΈΠ½Ρ†ΠΈΠΏ Ρ€Π°Π±ΠΎΡ‚Ρ‹ ΠΏΠΎΡ…ΠΎΠΆ Π½Π° ΠΏΠ°ΠΊΠ΅Ρ‚ zend-feed, (*2)

Π§Ρ‚Π΅Π½ΠΈΠ΅ Π»Π΅Π½Ρ‚Ρ‹ YML, (*3)


/*ΠΈΠΌΠΏΠΎΡ€Ρ‚ ΠΈΠ· Ρ„Π°ΠΉΠ»Π°*/ $feed=Reader::importFile('data/1.xml'); /*ΠΈΠΌΠΏΠΎΡ€Ρ‚ ΠΈΠ· URL*/ $feed=Reader::import('http://*******'); /*ΠΈΠΌΠΏΠΎΡ€Ρ‚ ΠΈΠ· строки*/ $feed=Reader::importString('*****'); /*Ρ‡Ρ‚Π΅Π½ΠΈΠ΅ ΠΈΠ½Ρ„ΠΎΡ€ΠΌΠ°Ρ†ΠΈΠΈ Π² сСкции описания, Π½Π°ΠΏΡ€ΠΈΠΌΠ΅Ρ€, name*/ $name=$feed->getName(); /*ΠΎΠ±Ρ…ΠΎΠ΄ всСх элСмСнтов Π² сСкции offers*/ foreach ($feed as $entry) { $description=$entry->getDescription(); /*Π²ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅Ρ‚ Π² Π²ΠΈΠ΄Π΅ ΠΊΠΎΠ»Π»Π΅ΠΊΡ†ΠΈΠΈ (спСц ΠΎΠ±ΡŠΠ΅ΠΊΡ‚), ΠΊΠΎΡ‚ΠΎΡ€ΡƒΡŽ ΠΌΠΎΠΆΠ½ΠΎ ΠΏΡ€Π΅ΠΎΠ±Ρ€Π°Π·ΠΎΠ²Π°Ρ‚ΡŒ Π² массив*/ $pics=$entry->getPicturies(); } /*ΠΏΡ€ΠΈΠΌΠ΅Ρ€ создания YML*/ $feed=new Feed(); $feed->setDateModified(); $feed->setName("Имя ΠΊΠΎΠΌΠΏΠ°Π½ΠΈΠΈ"); $feed->setCompany("Имя ΠΊΠΎΠΌΠΏΠ°Π½ΠΈΠΈ INC"); $feed->setUrl("http://wwww.345456.ru"); $feed->addCurrencies([ ["id"=>"RUR","rate"=>1], ["id"=>"USD","rate"=>10], ]); $feed->setCategories([ ["id"=>11,"parentId"=>1,"label"=>"катСгория 1"], ["id"=>1,"label"=>"катСгория 2"], ]); //сам Ρ‚ΠΎΠ²Π°Ρ€ $entry = $feed->createEntry(["id"=>12,"bid"=>111,"cbid"=>1,"available"=>true]); $entry->setUrl("http://23423534.ru/sdfdfgdfgdfg"); $entry->setPrice(234234.22); $entry->setCurrencyId("RUR"); $entry->setCategoriesId([45,1,2]); $entry->addCategoryId(405); $entry->addpicture("http://876.ry/444"); $entry->addpicture("http://876.ry/111"); $entry->setStore(true); $entry->setDelivery(true); $entry->setManufacturer_warranty(true); $entry->setName("Имя Ρ‚ΠΎΠ²Π°Ρ€Π°"); $entry->setVendor("ΠΏΡ€ΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡ‚Π΅Π»ΡŒ Ρ‚ΠΎΠ²Π°Ρ€Π°"); $entry->setModel("модСль Ρ‚ΠΎΠ²Π°Ρ€Π°"); $entry->setDescription("ОписаниС Ρ‚ΠΎΠ²Π°Ρ€Π°"); $entry->setSales_notes("sales_notes элСмСнт"); $entry->setbarcode("barcode элСмСнт"); $entry->setAge(0); $entry->setParams([ ["name"=>11,"unit"=>1,"label"=>"катСгория 1"], ["name"=>110,"unit"=>01,"label"=>"катСгория 10"], ]); $feed->addEntry($entry); /*ΡΠ»Π΅Π΄ΡƒΡŽΡ‰ΠΈΠΉ элСмСнт*/ echo $feed->export();

The Versions

18/05 2018

dev-master

9999999-dev https://masterflash.ru/

ΠΎΠ±Ρ€Π°Π±ΠΎΡ‚Ρ‡ΠΈΠΊ Π»Π΅Π½Ρ‚Ρ‹ YML

  Sources   Download

BSD-3-Clause

The Requires

 

zendframework zf yml