<?php

namespace ArtabanMarketplace\Model;

use ArtabanMarketplace\Model\Base\AmpSellerQuery as BaseAmpSellerQuery;
use Symfony\Component\HttpFoundation\Session\Session;


/**
 * Skeleton subclass for performing query and update operations on the 'amp_seller' table.
 *
 *
 *
 * You should add additional methods to this class to meet the
 * application requirements.  This class will only be generated as
 * long as it does not already exist in the output directory.
 *
 */
class AmpSellerQuery extends BaseAmpSellerQuery
{
    /**
     * @return mixed
     */
    public function getSellerIdFromSession() {
        $session = new Session();
        $admin_id = $session->get("thelia.admin_user")->getId();
        $seller_link_admin_object = AmpSellerAdminQuery::create()->findOneByAdminId($admin_id);
        $object= AmpSellerQuery::create()->findOneById($seller_link_admin_object->getAmpSellerID());
        /** @var Seller id */
        return $object->getId();
    }
} // AmpSellerQuery
