<commit_before><?php
/**
 * User: <NAME> <<EMAIL>>
 */
namespace Praxigento\Downline\Repo\Query\Snap\OnDate\ForDcp;

use Praxigento\Downline\Config as Cfg;

/**
 * Build query to get downline tree snap on given date with additional attributes for DCP.
 *
 * @SuppressWarnings(PHPMD.ShortVariable)
 */
class Builder
    extends \Praxigento\Core\Repo\Query\Def\Builder
{
    /** Tables aliases. */
    const AS_CUSTOMER = 'mageCust';
    const AS_DOWNLINE_CUSTOMER = 'prxgtDwnlCust';
    /** Columns aliases. */
    const A_COUNTRY_CODE = \Praxigento\Downline\Data\Entity\Customer::ATTR_COUNTRY_CODE;
    const A_EMAIL = Cfg::E_CUSTOMER_A_EMAIL;
    const A_MLM_ID = 'mlm_id';
    const A_NAME_FIRST = 'name_first';
    const A_NAME_LAST = 'name_last';
    const A_NAME_MIDDLE = 'name_middle';
    /** Bound variables names */
    const BIND_DATE = 'date';

    public function getSelectQuery(\Praxigento\Core\Repo\Query\IBuilder $qbuild = null)
    {
        $result = $qbuild->getSelectQuery();
        $asDwnlCust = self::AS_DOWNLINE_CUSTOMER;
        $asDwnlSnap = \Praxigento\Downline\Repo\Query\Snap\OnDate\Builder::AS_DWNL_SNAP;
        $asCust = self::AS_CUSTOMER;
        /* LEFT JOIN prxgt_dwnl_customer pdc */
        $tblDwnlCust = [
            $asDwnlCust => $this->resource->getTableName(\Praxigento\Downline\Data\Entity\Customer::ENTITY_NAME)
        ];
        $on = $asDwnlCust . '.' . \Praxigento\Downline\Data\Entity\Customer::ATTR_CUSTOMER_ID . '='
            . $asDwnlSnap . '.' . \Praxigento\Downline\Data\Entity\Snap::ATTR_CUSTOMER_ID;<commit_msg>MOBI-715 - Add API operation to get data for Downline reports<commit_after><?php
/**
 * User: <NAME> <<EMAIL>>
 */
namespace Praxigento\Downline\Repo\Query\Snap\OnDate\ForDcp;

use Praxigento\Downline\Config as Cfg;

/**
 * Build query to get downline tree snap on given date with additional attributes for DCP.
 *
 * @SuppressWarnings(PHPMD.ShortVariable)
 */
class Builder
    extends \Praxigento\Core\Repo\Query\Def\Builder
{
    /** Tables aliases. */
    const AS_CUSTOMER = 'mageCust';
    const AS_DOWNLINE_CUSTOMER = 'prxgtDwnlCust';
    /** Columns aliases. */
    const A_COUNTRY_CODE = \Praxigento\Downline\Data\Entity\Customer::ATTR_COUNTRY_CODE;
    const A_EMAIL = Cfg::E_CUSTOMER_A_EMAIL;
    const A_MLM_ID = 'mlm_id';
    const A_NAME_FIRST = 'name_first';
    const A_NAME_LAST = 'name_last';
    const A_NAME_MIDDLE = 'name_middle';

    public function getSelectQuery(\Praxigento\Core\Repo\Query\IBuilder $qbuild = null)
    {
        $result = $qbuild->getSelectQuery();
        $asDwnlCust = self::AS_DOWNLINE_CUSTOMER;
        $asDwnlSnap = \Praxigento\Downline\Repo\Query\Snap\OnDate\Builder::AS_DWNL_SNAP;
        $asCust = self::AS_CUSTOMER;
        /* LEFT JOIN prxgt_dwnl_customer pdc */
        $tblDwnlCust = [
            $asDwnlCust => $this->resource->getTableName(\Praxigento\Downline\Data\Entity\Customer::ENTITY_NAME)
        ];
        $on = $asDwnlCust . '.' . \Praxigento\Downline\Data\Entity\Customer::ATTR_CUSTOMER_ID . '='
            . $asDwnlSnap . '.' . \Praxigento\Downline\Data\Entity\Snap::ATTR_CUSTOMER_ID;
{'fraction_non_alphanumeric': 0.1296, 'fraction_numerical': 0.00096, 'mean_word_length': 3.329639889196676, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7050168', 'n_tokens_mistral': 1202, 'n_tokens_neox': 1187, 'n_words': 180}