PHP code example of ggbb / symfony-uploading-avito-cian-yandex-bundle
1. Go to this page and download the library: Download ggbb/symfony-uploading-avito-cian-yandex-bundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ggbb / symfony-uploading-avito-cian-yandex-bundle example snippets
namespace App\UploadingSerializer;
use App\Entity\EstateObject;
use Ggbb\SymfonyUploadingAvitoCianYandexBundle\Serializer\Interface\AvitoNormalizerInterface;
use Ggbb\SymfonyUploadingAvitoCianYandexBundle\Xml\Avito\Ad\Ad;
class AvitoNormalizer implements AvitoNormalizerInterface
{
/**
* @param mixed|EntityObject $object
* @param Ad $ad
* @return Ad
*/
public function normalize(mixed $object, Ad $ad): Ad
{
$ad = new Ad();
$ad->Id = $object->getId();
$ad->DateBegin = new \DateTime();
$ad->DateEnd = new \DateTime();
$ad->ListingFee = Ad::LISTING_FEE_SINGLE;
$ad->ManagerName = $object->getUser()->getName();
$ad->ContactPhone = $object->getUser()->getPhone();
$ad->Description = $object->getDescription();
...
return $ad;
}
}