repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
TheDMSGroup/mautic-contact-client | Model/Schedule.php | Schedule.evaluateDay | public function evaluateDay($returnHours = false, $date = null)
{
$hours = $this->getScheduleHours();
if (!$date) {
$date = clone $this->now;
}
if ($hours) {
$day = intval($date->format('N')) - 1;
if (isset($hours[$day])) {
if (
... | php | public function evaluateDay($returnHours = false, $date = null)
{
$hours = $this->getScheduleHours();
if (!$date) {
$date = clone $this->now;
}
if ($hours) {
$day = intval($date->format('N')) - 1;
if (isset($hours[$day])) {
if (
... | [
"public",
"function",
"evaluateDay",
"(",
"$",
"returnHours",
"=",
"false",
",",
"$",
"date",
"=",
"null",
")",
"{",
"$",
"hours",
"=",
"$",
"this",
"->",
"getScheduleHours",
"(",
")",
";",
"if",
"(",
"!",
"$",
"date",
")",
"{",
"$",
"date",
"=",
... | \
@param bool $returnHours
@param null|\DateTime $date
@return $this|mixed
@throws ContactClientException | [
"\\",
"@param",
"bool",
"$returnHours",
"@param",
"null|",
"\\",
"DateTime",
"$date"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/Schedule.php#L202-L230 |
TheDMSGroup/mautic-contact-client | Model/Schedule.php | Schedule.getScheduleHours | private function getScheduleHours()
{
if (!$this->scheduleHours) {
$jsonHelper = new JSONHelper();
$hoursString = $this->contactClient->getScheduleHours();
$this->scheduleHours = $jsonHelper->decodeArray($hoursString, 'ScheduleHours');
}
... | php | private function getScheduleHours()
{
if (!$this->scheduleHours) {
$jsonHelper = new JSONHelper();
$hoursString = $this->contactClient->getScheduleHours();
$this->scheduleHours = $jsonHelper->decodeArray($hoursString, 'ScheduleHours');
}
... | [
"private",
"function",
"getScheduleHours",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"scheduleHours",
")",
"{",
"$",
"jsonHelper",
"=",
"new",
"JSONHelper",
"(",
")",
";",
"$",
"hoursString",
"=",
"$",
"this",
"->",
"contactClient",
"->",
"getSch... | @return array|mixed
@throws \Exception | [
"@return",
"array|mixed"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/Schedule.php#L237-L246 |
TheDMSGroup/mautic-contact-client | Model/Schedule.php | Schedule.evaluateExclusions | public function evaluateExclusions($date = null)
{
if (!$date) {
$date = clone $this->now;
}
// Check dates of exclusion (if there are any).
$jsonHelper = new JSONHelper();
$exclusionsString = $this->contactClient->getScheduleExclusions();
$exclusion... | php | public function evaluateExclusions($date = null)
{
if (!$date) {
$date = clone $this->now;
}
// Check dates of exclusion (if there are any).
$jsonHelper = new JSONHelper();
$exclusionsString = $this->contactClient->getScheduleExclusions();
$exclusion... | [
"public",
"function",
"evaluateExclusions",
"(",
"$",
"date",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"date",
")",
"{",
"$",
"date",
"=",
"clone",
"$",
"this",
"->",
"now",
";",
"}",
"// Check dates of exclusion (if there are any).",
"$",
"jsonHelper",
... | @param null|\DateTime $date
@return $this
@throws ContactClientException | [
"@param",
"null|",
"\\",
"DateTime",
"$date"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/Schedule.php#L255-L325 |
TheDMSGroup/mautic-contact-client | Model/Schedule.php | Schedule.evaluateFileRate | private function evaluateFileRate($fileRate = 1, $date = null)
{
if (!$date) {
$date = clone $this->now;
}
$date->setTimezone($this->timezone);
$repo = $this->getFileRepository();
$fileCount = $repo->getCountByDate($date, $this->contactClient->getId());
... | php | private function evaluateFileRate($fileRate = 1, $date = null)
{
if (!$date) {
$date = clone $this->now;
}
$date->setTimezone($this->timezone);
$repo = $this->getFileRepository();
$fileCount = $repo->getCountByDate($date, $this->contactClient->getId());
... | [
"private",
"function",
"evaluateFileRate",
"(",
"$",
"fileRate",
"=",
"1",
",",
"$",
"date",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"date",
")",
"{",
"$",
"date",
"=",
"clone",
"$",
"this",
"->",
"now",
";",
"}",
"$",
"date",
"->",
"setTimez... | Test if we can send/build another file for the day in question.
@param int $fileRate
@param null|\DateTime $date
@return int
@throws ContactClientException | [
"Test",
"if",
"we",
"can",
"send",
"/",
"build",
"another",
"file",
"for",
"the",
"day",
"in",
"question",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/Schedule.php#L337-L357 |
TheDMSGroup/mautic-contact-client | Model/Schedule.php | Schedule.evaluateTime | public function evaluateTime($returnRange = false)
{
$hours = $this->getScheduleHours();
if ($hours) {
$day = intval($this->now->format('N')) - 1;
if (isset($hours[$day])) {
if (
isset($hours[$day]->isActive)
&& !$hours[... | php | public function evaluateTime($returnRange = false)
{
$hours = $this->getScheduleHours();
if ($hours) {
$day = intval($this->now->format('N')) - 1;
if (isset($hours[$day])) {
if (
isset($hours[$day]->isActive)
&& !$hours[... | [
"public",
"function",
"evaluateTime",
"(",
"$",
"returnRange",
"=",
"false",
")",
"{",
"$",
"hours",
"=",
"$",
"this",
"->",
"getScheduleHours",
"(",
")",
";",
"if",
"(",
"$",
"hours",
")",
"{",
"$",
"day",
"=",
"intval",
"(",
"$",
"this",
"->",
"n... | @param bool $returnRange
@return $this|array
@throws ContactClientException | [
"@param",
"bool",
"$returnRange"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/Schedule.php#L374-L410 |
TheDMSGroup/mautic-contact-client | Model/Schedule.php | Schedule.setNow | public function setNow(\DateTime $now = null)
{
if (!$now) {
$now = new \DateTime();
}
$this->now = $now;
return $this;
} | php | public function setNow(\DateTime $now = null)
{
if (!$now) {
$now = new \DateTime();
}
$this->now = $now;
return $this;
} | [
"public",
"function",
"setNow",
"(",
"\\",
"DateTime",
"$",
"now",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"now",
")",
"{",
"$",
"now",
"=",
"new",
"\\",
"DateTime",
"(",
")",
";",
"}",
"$",
"this",
"->",
"now",
"=",
"$",
"now",
";",
"ret... | @param \DateTime|null $now
@return $this
@throws \Exception | [
"@param",
"\\",
"DateTime|null",
"$now"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/Schedule.php#L427-L436 |
TheDMSGroup/mautic-contact-client | Model/Schedule.php | Schedule.setTimezone | public function setTimezone(\DateTimeZone $timezone = null)
{
if (!$timezone) {
$timezone = $this->contactClient->getScheduleTimezone();
if (!$timezone) {
$timezone = $this->coreParametersHelper->getParameter(
'default_timezone'
);
... | php | public function setTimezone(\DateTimeZone $timezone = null)
{
if (!$timezone) {
$timezone = $this->contactClient->getScheduleTimezone();
if (!$timezone) {
$timezone = $this->coreParametersHelper->getParameter(
'default_timezone'
);
... | [
"public",
"function",
"setTimezone",
"(",
"\\",
"DateTimeZone",
"$",
"timezone",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"timezone",
")",
"{",
"$",
"timezone",
"=",
"$",
"this",
"->",
"contactClient",
"->",
"getScheduleTimezone",
"(",
")",
";",
"if",... | Set Client timezone, defaulting to Mautic or System as is relevant.
@param \DateTimeZone $timezone
@return $this | [
"Set",
"Client",
"timezone",
"defaulting",
"to",
"Mautic",
"or",
"System",
"as",
"is",
"relevant",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/Schedule.php#L453-L469 |
TheDMSGroup/mautic-contact-client | Entity/Queue.php | Queue.setCampaignEvent | public function setCampaignEvent($campaignEvent)
{
if ($campaignEvent instanceof CampaignEvent) {
$campaignEvent = $campaignEvent->getId();
}
$this->campaignEvent = $campaignEvent;
return $this;
} | php | public function setCampaignEvent($campaignEvent)
{
if ($campaignEvent instanceof CampaignEvent) {
$campaignEvent = $campaignEvent->getId();
}
$this->campaignEvent = $campaignEvent;
return $this;
} | [
"public",
"function",
"setCampaignEvent",
"(",
"$",
"campaignEvent",
")",
"{",
"if",
"(",
"$",
"campaignEvent",
"instanceof",
"CampaignEvent",
")",
"{",
"$",
"campaignEvent",
"=",
"$",
"campaignEvent",
"->",
"getId",
"(",
")",
";",
"}",
"$",
"this",
"->",
... | @param $campaignEvent
@return $this | [
"@param",
"$campaignEvent"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Entity/Queue.php#L114-L122 |
TheDMSGroup/mautic-contact-client | Entity/Queue.php | Queue.setCampaign | public function setCampaign($campaign)
{
if ($campaign instanceof Campaign) {
$campaign = $campaign->getId();
}
$this->campaign = $campaign;
return $this;
} | php | public function setCampaign($campaign)
{
if ($campaign instanceof Campaign) {
$campaign = $campaign->getId();
}
$this->campaign = $campaign;
return $this;
} | [
"public",
"function",
"setCampaign",
"(",
"$",
"campaign",
")",
"{",
"if",
"(",
"$",
"campaign",
"instanceof",
"Campaign",
")",
"{",
"$",
"campaign",
"=",
"$",
"campaign",
"->",
"getId",
"(",
")",
";",
"}",
"$",
"this",
"->",
"campaign",
"=",
"$",
"c... | @param $campaign
@return $this | [
"@param",
"$campaign"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Entity/Queue.php#L137-L145 |
TheDMSGroup/mautic-contact-client | Entity/Queue.php | Queue.setContact | public function setContact($contact)
{
if ($contact instanceof Contact) {
$contact = $contact->getId();
}
$this->contact = $contact;
return $this;
} | php | public function setContact($contact)
{
if ($contact instanceof Contact) {
$contact = $contact->getId();
}
$this->contact = $contact;
return $this;
} | [
"public",
"function",
"setContact",
"(",
"$",
"contact",
")",
"{",
"if",
"(",
"$",
"contact",
"instanceof",
"Contact",
")",
"{",
"$",
"contact",
"=",
"$",
"contact",
"->",
"getId",
"(",
")",
";",
"}",
"$",
"this",
"->",
"contact",
"=",
"$",
"contact"... | @param Contact|int $contact
@return $this | [
"@param",
"Contact|int",
"$contact"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Entity/Queue.php#L208-L217 |
TheDMSGroup/mautic-contact-client | Model/Cache.php | Cache.create | public function create()
{
$entities = [];
$exclusive = $this->getExclusiveRules();
if (count($exclusive)) {
// Create an entry for *each* exclusivity rule as they will end up with different dates of exclusivity
// expiration. Any of these entries will suffice for du... | php | public function create()
{
$entities = [];
$exclusive = $this->getExclusiveRules();
if (count($exclusive)) {
// Create an entry for *each* exclusivity rule as they will end up with different dates of exclusivity
// expiration. Any of these entries will suffice for du... | [
"public",
"function",
"create",
"(",
")",
"{",
"$",
"entities",
"=",
"[",
"]",
";",
"$",
"exclusive",
"=",
"$",
"this",
"->",
"getExclusiveRules",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"exclusive",
")",
")",
"{",
"// Create an entry for *each* exc... | Create all necessary cache entities for the given Contact and Contact Client.
@throws \Exception | [
"Create",
"all",
"necessary",
"cache",
"entities",
"for",
"the",
"given",
"Contact",
"and",
"Contact",
"Client",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/Cache.php#L56-L89 |
TheDMSGroup/mautic-contact-client | Model/Cache.php | Cache.getExclusiveRules | public function getExclusiveRules()
{
$jsonHelper = new JSONHelper();
$exclusive = $jsonHelper->decodeObject($this->contactClient->getExclusive(), 'Exclusive');
$this->excludeIrrelevantRules($exclusive);
return $this->mergeRules($exclusive);
} | php | public function getExclusiveRules()
{
$jsonHelper = new JSONHelper();
$exclusive = $jsonHelper->decodeObject($this->contactClient->getExclusive(), 'Exclusive');
$this->excludeIrrelevantRules($exclusive);
return $this->mergeRules($exclusive);
} | [
"public",
"function",
"getExclusiveRules",
"(",
")",
"{",
"$",
"jsonHelper",
"=",
"new",
"JSONHelper",
"(",
")",
";",
"$",
"exclusive",
"=",
"$",
"jsonHelper",
"->",
"decodeObject",
"(",
"$",
"this",
"->",
"contactClient",
"->",
"getExclusive",
"(",
")",
"... | Given the Contact and Contact Client, discern which exclusivity entries need to be cached.
@throws \Exception | [
"Given",
"the",
"Contact",
"and",
"Contact",
"Client",
"discern",
"which",
"exclusivity",
"entries",
"need",
"to",
"be",
"cached",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/Cache.php#L96-L104 |
TheDMSGroup/mautic-contact-client | Model/Cache.php | Cache.getUtmSource | private function getUtmSource()
{
if (!$this->utmSource) {
$utmHelper = $this->getContainer()->get('mautic.contactclient.helper.utmsource');
$this->utmSource = $utmHelper->getFirstUtmSource($this->contact);
$this->em->clear('Mautic\LeadBundle\Entity\UtmTag');
... | php | private function getUtmSource()
{
if (!$this->utmSource) {
$utmHelper = $this->getContainer()->get('mautic.contactclient.helper.utmsource');
$this->utmSource = $utmHelper->getFirstUtmSource($this->contact);
$this->em->clear('Mautic\LeadBundle\Entity\UtmTag');
... | [
"private",
"function",
"getUtmSource",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"utmSource",
")",
"{",
"$",
"utmHelper",
"=",
"$",
"this",
"->",
"getContainer",
"(",
")",
"->",
"get",
"(",
"'mautic.contactclient.helper.utmsource'",
")",
";",
"$",
... | Get the original / first utm source code for contact.
@return string
@throws \Exception | [
"Get",
"the",
"original",
"/",
"first",
"utm",
"source",
"code",
"for",
"contact",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/Cache.php#L148-L157 |
TheDMSGroup/mautic-contact-client | Model/Cache.php | Cache.mergeRules | private function mergeRules($rules, $requireMatching = true)
{
$newRules = [];
if (isset($rules->rules) && is_array($rules->rules)) {
foreach ($rules->rules as $rule) {
// Exclusivity and Duplicates have matching, Limits may not.
if (
(... | php | private function mergeRules($rules, $requireMatching = true)
{
$newRules = [];
if (isset($rules->rules) && is_array($rules->rules)) {
foreach ($rules->rules as $rule) {
// Exclusivity and Duplicates have matching, Limits may not.
if (
(... | [
"private",
"function",
"mergeRules",
"(",
"$",
"rules",
",",
"$",
"requireMatching",
"=",
"true",
")",
"{",
"$",
"newRules",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"rules",
"->",
"rules",
")",
"&&",
"is_array",
"(",
"$",
"rules",
"->",
"... | Validate and merge the rules object (exclusivity/duplicate/limits).
@param $rules
@param bool $requireMatching
@return array | [
"Validate",
"and",
"merge",
"the",
"rules",
"object",
"(",
"exclusivity",
"/",
"duplicate",
"/",
"limits",
")",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/Cache.php#L179-L218 |
TheDMSGroup/mautic-contact-client | Model/Cache.php | Cache.createEntity | private function createEntity()
{
$entity = new CacheEntity();
$entity->setAddress1(trim(ucwords($this->contact->getAddress1())));
$entity->setAddress2(trim(ucwords($this->contact->getAddress2())));
$category = $this->contactClient->getCategory();
if ($category) {
... | php | private function createEntity()
{
$entity = new CacheEntity();
$entity->setAddress1(trim(ucwords($this->contact->getAddress1())));
$entity->setAddress2(trim(ucwords($this->contact->getAddress2())));
$category = $this->contactClient->getCategory();
if ($category) {
... | [
"private",
"function",
"createEntity",
"(",
")",
"{",
"$",
"entity",
"=",
"new",
"CacheEntity",
"(",
")",
";",
"$",
"entity",
"->",
"setAddress1",
"(",
"trim",
"(",
"ucwords",
"(",
"$",
"this",
"->",
"contact",
"->",
"getAddress1",
"(",
")",
")",
")",
... | Create a new cache entity with the existing Contact and contactClient.
Normalize the fields as much as possible to aid in exclusive/duplicate/limit correlation.
@return CacheEntity
@throws \Exception | [
"Create",
"a",
"new",
"cache",
"entity",
"with",
"the",
"existing",
"Contact",
"and",
"contactClient",
".",
"Normalize",
"the",
"fields",
"as",
"much",
"as",
"possible",
"to",
"aid",
"in",
"exclusive",
"/",
"duplicate",
"/",
"limit",
"correlation",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/Cache.php#L228-L261 |
TheDMSGroup/mautic-contact-client | Model/Cache.php | Cache.getTimezone | private function getTimezone()
{
if (!$this->timezone) {
$this->timezone = $this->getContainer()->get('mautic.helper.core_parameters')->getParameter(
'default_timezone'
);
}
return $this->timezone;
} | php | private function getTimezone()
{
if (!$this->timezone) {
$this->timezone = $this->getContainer()->get('mautic.helper.core_parameters')->getParameter(
'default_timezone'
);
}
return $this->timezone;
} | [
"private",
"function",
"getTimezone",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"timezone",
")",
"{",
"$",
"this",
"->",
"timezone",
"=",
"$",
"this",
"->",
"getContainer",
"(",
")",
"->",
"get",
"(",
"'mautic.helper.core_parameters'",
")",
"->",... | Get the global timezone setting.
@return mixed
@throws \Exception | [
"Get",
"the",
"global",
"timezone",
"setting",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/Cache.php#L303-L312 |
TheDMSGroup/mautic-contact-client | Model/Cache.php | Cache.evaluateExclusive | public function evaluateExclusive()
{
if (!$this->contactClient->getExclusiveIgnore()) {
$exclusive = $this->getRepository()->findExclusive(
$this->contact,
$this->contactClient,
$this->dateSend
);
if ($exclusive) {
... | php | public function evaluateExclusive()
{
if (!$this->contactClient->getExclusiveIgnore()) {
$exclusive = $this->getRepository()->findExclusive(
$this->contact,
$this->contactClient,
$this->dateSend
);
if ($exclusive) {
... | [
"public",
"function",
"evaluateExclusive",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"contactClient",
"->",
"getExclusiveIgnore",
"(",
")",
")",
"{",
"$",
"exclusive",
"=",
"$",
"this",
"->",
"getRepository",
"(",
")",
"->",
"findExclusive",
"(",
... | Given a contact, evaluate exclusivity rules of all cache entries against it.
@throws ContactClientException
@throws \Exception | [
"Given",
"a",
"contact",
"evaluate",
"exclusivity",
"rules",
"of",
"all",
"cache",
"entries",
"against",
"it",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/Cache.php#L320-L340 |
TheDMSGroup/mautic-contact-client | Model/Cache.php | Cache.evaluateDuplicate | public function evaluateDuplicate()
{
$duplicate = $this->getRepository()->findDuplicate(
$this->contact,
$this->contactClient,
$this->getDuplicateRules(),
$this->getUtmSource(),
$this->getTimezone(),
$this->dateSend
);
... | php | public function evaluateDuplicate()
{
$duplicate = $this->getRepository()->findDuplicate(
$this->contact,
$this->contactClient,
$this->getDuplicateRules(),
$this->getUtmSource(),
$this->getTimezone(),
$this->dateSend
);
... | [
"public",
"function",
"evaluateDuplicate",
"(",
")",
"{",
"$",
"duplicate",
"=",
"$",
"this",
"->",
"getRepository",
"(",
")",
"->",
"findDuplicate",
"(",
"$",
"this",
"->",
"contact",
",",
"$",
"this",
"->",
"contactClient",
",",
"$",
"this",
"->",
"get... | Using the duplicate rules, evaluate if the current contact matches any entry in the cache.
@throws ContactClientException
@throws \Exception | [
"Using",
"the",
"duplicate",
"rules",
"evaluate",
"if",
"the",
"current",
"contact",
"matches",
"any",
"entry",
"in",
"the",
"cache",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/Cache.php#L348-L369 |
TheDMSGroup/mautic-contact-client | Model/Cache.php | Cache.evaluateLimits | public function evaluateLimits()
{
$limits = $this->getRepository()->findLimit(
$this->contactClient,
$this->getLimitRules(),
$this->getTimezone(),
$this->dateSend
);
if ($limits) {
throw new ContactClientException(
... | php | public function evaluateLimits()
{
$limits = $this->getRepository()->findLimit(
$this->contactClient,
$this->getLimitRules(),
$this->getTimezone(),
$this->dateSend
);
if ($limits) {
throw new ContactClientException(
... | [
"public",
"function",
"evaluateLimits",
"(",
")",
"{",
"$",
"limits",
"=",
"$",
"this",
"->",
"getRepository",
"(",
")",
"->",
"findLimit",
"(",
"$",
"this",
"->",
"contactClient",
",",
"$",
"this",
"->",
"getLimitRules",
"(",
")",
",",
"$",
"this",
"-... | Using the duplicate rules, evaluate if the current contact matches any entry in the cache.
@throws ContactClientException
@throws \Exception | [
"Using",
"the",
"duplicate",
"rules",
"evaluate",
"if",
"the",
"current",
"contact",
"matches",
"any",
"entry",
"in",
"the",
"cache",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/Cache.php#L390-L409 |
TheDMSGroup/mautic-contact-client | Model/Cache.php | Cache.getLimitRules | public function getLimitRules()
{
$jsonHelper = new JSONHelper();
$limits = $jsonHelper->decodeObject($this->contactClient->getLimits(), 'Limits');
$this->excludeIrrelevantRules($limits);
return $this->mergeRules($limits, false);
} | php | public function getLimitRules()
{
$jsonHelper = new JSONHelper();
$limits = $jsonHelper->decodeObject($this->contactClient->getLimits(), 'Limits');
$this->excludeIrrelevantRules($limits);
return $this->mergeRules($limits, false);
} | [
"public",
"function",
"getLimitRules",
"(",
")",
"{",
"$",
"jsonHelper",
"=",
"new",
"JSONHelper",
"(",
")",
";",
"$",
"limits",
"=",
"$",
"jsonHelper",
"->",
"decodeObject",
"(",
"$",
"this",
"->",
"contactClient",
"->",
"getLimits",
"(",
")",
",",
"'Li... | Given the Contact and Contact Client, get the rules used to evaluate limits.
@throws \Exception | [
"Given",
"the",
"Contact",
"and",
"Contact",
"Client",
"get",
"the",
"rules",
"used",
"to",
"evaluate",
"limits",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/Cache.php#L416-L424 |
TheDMSGroup/mautic-contact-client | Model/Cache.php | Cache.setDateSend | public function setDateSend($dateSend = null)
{
if (!$dateSend) {
$this->dateSend = new \DateTime();
} else {
$this->dateSend = $dateSend;
}
return $this;
} | php | public function setDateSend($dateSend = null)
{
if (!$dateSend) {
$this->dateSend = new \DateTime();
} else {
$this->dateSend = $dateSend;
}
return $this;
} | [
"public",
"function",
"setDateSend",
"(",
"$",
"dateSend",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"dateSend",
")",
"{",
"$",
"this",
"->",
"dateSend",
"=",
"new",
"\\",
"DateTime",
"(",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"dateSend"... | @param $dateSend
@return $this | [
"@param",
"$dateSend"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/Cache.php#L451-L460 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.setAttribution | public function setAttribution($attribution)
{
if ($this->queue) {
$this->queue->setAttribution($attribution);
$this->getQueueRepository()->saveEntity($this->queue);
}
} | php | public function setAttribution($attribution)
{
if ($this->queue) {
$this->queue->setAttribution($attribution);
$this->getQueueRepository()->saveEntity($this->queue);
}
} | [
"public",
"function",
"setAttribution",
"(",
"$",
"attribution",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"queue",
")",
"{",
"$",
"this",
"->",
"queue",
"->",
"setAttribution",
"(",
"$",
"attribution",
")",
";",
"$",
"this",
"->",
"getQueueRepository",
"(... | Append the current queue entity with attribution.
@param $attribution | [
"Append",
"the",
"current",
"queue",
"entity",
"with",
"attribution",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L229-L235 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.reset | public function reset(
$exclusions = [
'contactClientModel',
'tokenHelper',
'em',
'formModel',
'eventModel',
'contactModel',
'pathsHelper',
'coreParametersHelper',
'filesystemLocal',
'mailHelp... | php | public function reset(
$exclusions = [
'contactClientModel',
'tokenHelper',
'em',
'formModel',
'eventModel',
'contactModel',
'pathsHelper',
'coreParametersHelper',
'filesystemLocal',
'mailHelp... | [
"public",
"function",
"reset",
"(",
"$",
"exclusions",
"=",
"[",
"'contactClientModel'",
",",
"'tokenHelper'",
",",
"'em'",
",",
"'formModel'",
",",
"'eventModel'",
",",
"'contactModel'",
",",
"'pathsHelper'",
",",
"'coreParametersHelper'",
",",
"'filesystemLocal'",
... | Reset local class variables.
@param array $exclusions optional array of local variables to keep current values
@return $this | [
"Reset",
"local",
"class",
"variables",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L252-L276 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.setContactClient | public function setContactClient(ContactClient $contactClient)
{
$this->contactClient = $contactClient;
$this->setPayload($this->contactClient->getFilePayload());
return $this;
} | php | public function setContactClient(ContactClient $contactClient)
{
$this->contactClient = $contactClient;
$this->setPayload($this->contactClient->getFilePayload());
return $this;
} | [
"public",
"function",
"setContactClient",
"(",
"ContactClient",
"$",
"contactClient",
")",
"{",
"$",
"this",
"->",
"contactClient",
"=",
"$",
"contactClient",
";",
"$",
"this",
"->",
"setPayload",
"(",
"$",
"this",
"->",
"contactClient",
"->",
"getFilePayload",
... | @param ContactClient $contactClient
@return $this
@throws ContactClientException | [
"@param",
"ContactClient",
"$contactClient"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L313-L319 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.setSettings | private function setSettings($settings)
{
if ($settings) {
foreach ($this->settings as $key => &$value) {
if (!empty($settings->{$key}) && $settings->{$key}) {
if (is_object($settings->{$key})) {
$value = array_merge(
... | php | private function setSettings($settings)
{
if ($settings) {
foreach ($this->settings as $key => &$value) {
if (!empty($settings->{$key}) && $settings->{$key}) {
if (is_object($settings->{$key})) {
$value = array_merge(
... | [
"private",
"function",
"setSettings",
"(",
"$",
"settings",
")",
"{",
"if",
"(",
"$",
"settings",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"settings",
"as",
"$",
"key",
"=>",
"&",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"se... | Retrieve File settings from the payload to override our defaults.
@param object $settings | [
"Retrieve",
"File",
"settings",
"from",
"the",
"payload",
"to",
"override",
"our",
"defaults",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L371-L387 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.run | public function run($step = 'add')
{
$this->setLogs($step, 'step');
switch ($step) {
// Step 1: Validate and add a contact to a queue for the next file for the client.
case 'add':
$this->getFieldValues();
$this->fileEntitySelect(true);
... | php | public function run($step = 'add')
{
$this->setLogs($step, 'step');
switch ($step) {
// Step 1: Validate and add a contact to a queue for the next file for the client.
case 'add':
$this->getFieldValues();
$this->fileEntitySelect(true);
... | [
"public",
"function",
"run",
"(",
"$",
"step",
"=",
"'add'",
")",
"{",
"$",
"this",
"->",
"setLogs",
"(",
"$",
"step",
",",
"'step'",
")",
";",
"switch",
"(",
"$",
"step",
")",
"{",
"// Step 1: Validate and add a contact to a queue for the next file for the clie... | These steps can occur in different sessions.
@param string $step
@return $this
@throws ContactClientException | [
"These",
"steps",
"can",
"occur",
"in",
"different",
"sessions",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L426-L458 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.getFieldValues | private function getFieldValues()
{
$requestFields = [];
if (!empty($this->payload->body) && !is_string($this->payload->body)) {
$this->tokenHelper->newSession(
$this->contactClient,
$this->contact,
$this->payload,
$this->ca... | php | private function getFieldValues()
{
$requestFields = [];
if (!empty($this->payload->body) && !is_string($this->payload->body)) {
$this->tokenHelper->newSession(
$this->contactClient,
$this->contact,
$this->payload,
$this->ca... | [
"private",
"function",
"getFieldValues",
"(",
")",
"{",
"$",
"requestFields",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"payload",
"->",
"body",
")",
"&&",
"!",
"is_string",
"(",
"$",
"this",
"->",
"payload",
"->",
"body",
... | Gets the token rendered field values (evaluating required fields in the process).
@throws ContactClientException | [
"Gets",
"the",
"token",
"rendered",
"field",
"values",
"(",
"evaluating",
"required",
"fields",
"in",
"the",
"process",
")",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L465-L498 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.fieldValues | private function fieldValues($fields)
{
$result = [];
foreach ($fields as $field) {
if (!$this->test && (isset($field->test_only) ? $field->test_only : false)) {
// Skip this field as it is for test mode only.
continue;
}
$key = iss... | php | private function fieldValues($fields)
{
$result = [];
foreach ($fields as $field) {
if (!$this->test && (isset($field->test_only) ? $field->test_only : false)) {
// Skip this field as it is for test mode only.
continue;
}
$key = iss... | [
"private",
"function",
"fieldValues",
"(",
"$",
"fields",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"fields",
"as",
"$",
"field",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"test",
"&&",
"(",
"isset",
"(",
"$",
"field",
... | Tokenize/parse fields from the file Payload for transit.
@param $fields
@return array
@throws ContactClientException
@todo - This method also exists in the other payload type with a minor difference | [
"Tokenize",
"/",
"parse",
"fields",
"from",
"the",
"file",
"Payload",
"for",
"transit",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L511-L556 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.fileEntitySelect | private function fileEntitySelect($create = false, $status = null)
{
if (!$this->file && $this->contactClient) {
$file = null;
// Discern the next file entity to use.
if (!$status) {
$status = File::STATUS_QUEUEING;
}
if (!$this->te... | php | private function fileEntitySelect($create = false, $status = null)
{
if (!$this->file && $this->contactClient) {
$file = null;
// Discern the next file entity to use.
if (!$status) {
$status = File::STATUS_QUEUEING;
}
if (!$this->te... | [
"private",
"function",
"fileEntitySelect",
"(",
"$",
"create",
"=",
"false",
",",
"$",
"status",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"file",
"&&",
"$",
"this",
"->",
"contactClient",
")",
"{",
"$",
"file",
"=",
"null",
";",
"/... | @param bool $create
@param null $status
@return $this
@throws ContactClientException | [
"@param",
"bool",
"$create",
"@param",
"null",
"$status"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L566-L609 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.fileEntityRefreshSettings | private function fileEntityRefreshSettings()
{
if ($this->file) {
// Update settings from the Contact Client entity.
if (!empty($this->settings['name']) && !$this->file->getLocation()) {
// Preliminary name containing tokens.
$this->file->setName($this... | php | private function fileEntityRefreshSettings()
{
if ($this->file) {
// Update settings from the Contact Client entity.
if (!empty($this->settings['name']) && !$this->file->getLocation()) {
// Preliminary name containing tokens.
$this->file->setName($this... | [
"private",
"function",
"fileEntityRefreshSettings",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"file",
")",
"{",
"// Update settings from the Contact Client entity.",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"settings",
"[",
"'name'",
"]",
")",
"&&",... | Update fields on the file entity based on latest data.
@return $this | [
"Update",
"fields",
"on",
"the",
"file",
"entity",
"based",
"on",
"latest",
"data",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L624-L671 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.addContactToQueue | private function addContactToQueue()
{
if (
!$this->queue
&& $this->file
&& $this->contactClient
&& $this->contact
) {
// Check for a pre-existing instance of this contact queued for this file.
$queue = $this->getQueueRepository... | php | private function addContactToQueue()
{
if (
!$this->queue
&& $this->file
&& $this->contactClient
&& $this->contact
) {
// Check for a pre-existing instance of this contact queued for this file.
$queue = $this->getQueueRepository... | [
"private",
"function",
"addContactToQueue",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"queue",
"&&",
"$",
"this",
"->",
"file",
"&&",
"$",
"this",
"->",
"contactClient",
"&&",
"$",
"this",
"->",
"contact",
")",
"{",
"// Check for a pre-existing ins... | @return Queue|null|object
@throws ContactClientException | [
"@return",
"Queue|null|object"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L678-L736 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.evaluateSchedule | public function evaluateSchedule($prepFile = false)
{
if (!$this->scheduleStart && !$this->test) {
$rate = max(1, (int) $this->settings['rate']);
$endDay = 30;
$this->scheduleModel
->reset()
->setContactClient($this->contactClient)
... | php | public function evaluateSchedule($prepFile = false)
{
if (!$this->scheduleStart && !$this->test) {
$rate = max(1, (int) $this->settings['rate']);
$endDay = 30;
$this->scheduleModel
->reset()
->setContactClient($this->contactClient)
... | [
"public",
"function",
"evaluateSchedule",
"(",
"$",
"prepFile",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"scheduleStart",
"&&",
"!",
"$",
"this",
"->",
"test",
")",
"{",
"$",
"rate",
"=",
"max",
"(",
"1",
",",
"(",
"int",
")",
"... | Assuming we have a file entity ready to go
Throws an exception if an open slot is not available.
@param bool $prepFile
@return \DateTime|null
@throws ContactClientException | [
"Assuming",
"we",
"have",
"a",
"file",
"entity",
"ready",
"to",
"go",
"Throws",
"an",
"exception",
"if",
"an",
"open",
"slot",
"is",
"not",
"available",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L748-L793 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.fileBuild | private function fileBuild()
{
if (!$this->contactClient || !$this->file) {
return $this;
}
if ($this->test) {
return $this->fileBuildTest();
}
$filter = [];
$filter['force'][] = [
'column' => 'q.contactClient',
... | php | private function fileBuild()
{
if (!$this->contactClient || !$this->file) {
return $this;
}
if ($this->test) {
return $this->fileBuildTest();
}
$filter = [];
$filter['force'][] = [
'column' => 'q.contactClient',
... | [
"private",
"function",
"fileBuild",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"contactClient",
"||",
"!",
"$",
"this",
"->",
"file",
")",
"{",
"return",
"$",
"this",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"test",
")",
"{",
"return",
"$",... | Build out the original temp file.
@return $this
@throws ContactClientException | [
"Build",
"out",
"the",
"original",
"temp",
"file",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L802-L916 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.fileAddRow | private function fileAddRow($fieldValues = [])
{
if ($fieldValues) {
$this->getFileWriter()->write($fieldValues);
if (0 === $this->count) {
// Indicate to other processes that this file is being compiled.
$this->file->setStatus(File::STATUS_BUILDING);
... | php | private function fileAddRow($fieldValues = [])
{
if ($fieldValues) {
$this->getFileWriter()->write($fieldValues);
if (0 === $this->count) {
// Indicate to other processes that this file is being compiled.
$this->file->setStatus(File::STATUS_BUILDING);
... | [
"private",
"function",
"fileAddRow",
"(",
"$",
"fieldValues",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"fieldValues",
")",
"{",
"$",
"this",
"->",
"getFileWriter",
"(",
")",
"->",
"write",
"(",
"$",
"fieldValues",
")",
";",
"if",
"(",
"0",
"===",
"... | @param array $fieldValues
@return $this | [
"@param",
"array",
"$fieldValues"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L964-L977 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.fileGenerateTmp | private function fileGenerateTmp($compression = null)
{
$fileTmp = null;
$compression = 'none' == $compression ? null : $compression;
while (true) {
$fileTmpName = uniqid($this->getFileName($compression), true);
$fileTmp = sys_get_temp_dir().'/'.$fileTmpName;
... | php | private function fileGenerateTmp($compression = null)
{
$fileTmp = null;
$compression = 'none' == $compression ? null : $compression;
while (true) {
$fileTmpName = uniqid($this->getFileName($compression), true);
$fileTmp = sys_get_temp_dir().'/'.$fileTmpName;
... | [
"private",
"function",
"fileGenerateTmp",
"(",
"$",
"compression",
"=",
"null",
")",
"{",
"$",
"fileTmp",
"=",
"null",
";",
"$",
"compression",
"=",
"'none'",
"==",
"$",
"compression",
"?",
"null",
":",
"$",
"compression",
";",
"while",
"(",
"true",
")",... | Generates a temporary path for file generation.
@param string $compression
@return null|string | [
"Generates",
"a",
"temporary",
"path",
"for",
"file",
"generation",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L1046-L1063 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.getFileName | private function getFileName($compression = null)
{
$compression = 'none' == $compression ? null : $compression;
$this->tokenHelper->newSession(
$this->contactClient,
$this->contact, // Context of the first/last client in the file will be used if available
$this->... | php | private function getFileName($compression = null)
{
$compression = 'none' == $compression ? null : $compression;
$this->tokenHelper->newSession(
$this->contactClient,
$this->contact, // Context of the first/last client in the file will be used if available
$this->... | [
"private",
"function",
"getFileName",
"(",
"$",
"compression",
"=",
"null",
")",
"{",
"$",
"compression",
"=",
"'none'",
"==",
"$",
"compression",
"?",
"null",
":",
"$",
"compression",
";",
"$",
"this",
"->",
"tokenHelper",
"->",
"newSession",
"(",
"$",
... | Discern the desired output file name for a new file.
@param null $compression
@return string
@throws \Exception | [
"Discern",
"the",
"desired",
"output",
"file",
"name",
"for",
"a",
"new",
"file",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L1074-L1124 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.fileEntitySave | private function fileEntitySave()
{
if (!$this->file) {
return;
}
if ($this->file->isNew() || $this->file->getChanges()) {
if ($this->contactClient->getId()) {
$this->formModel->saveEntity($this->file, true);
}
}
} | php | private function fileEntitySave()
{
if (!$this->file) {
return;
}
if ($this->file->isNew() || $this->file->getChanges()) {
if ($this->contactClient->getId()) {
$this->formModel->saveEntity($this->file, true);
}
}
} | [
"private",
"function",
"fileEntitySave",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"file",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"file",
"->",
"isNew",
"(",
")",
"||",
"$",
"this",
"->",
"file",
"->",
"getChanges",
"... | Save any file changes using the form model. | [
"Save",
"any",
"file",
"changes",
"using",
"the",
"form",
"model",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L1129-L1139 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.fileCompress | private function fileCompress()
{
if ($this->file && $this->file->getTmp()) {
$compression = $this->file->getCompression();
if ($compression && in_array($compression, ['tar.gz', 'tar.bz2', 'zip'])) {
// Discern new tmp file name (with compression applied).
... | php | private function fileCompress()
{
if ($this->file && $this->file->getTmp()) {
$compression = $this->file->getCompression();
if ($compression && in_array($compression, ['tar.gz', 'tar.bz2', 'zip'])) {
// Discern new tmp file name (with compression applied).
... | [
"private",
"function",
"fileCompress",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"file",
"&&",
"$",
"this",
"->",
"file",
"->",
"getTmp",
"(",
")",
")",
"{",
"$",
"compression",
"=",
"$",
"this",
"->",
"file",
"->",
"getCompression",
"(",
")",
"... | Perform compression on the temp file.
@return $this
@throws ContactClientException | [
"Perform",
"compression",
"on",
"the",
"temp",
"file",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L1160-L1217 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.fileMove | private function fileMove($overwrite = true)
{
if (!$this->file->getLocation() || $overwrite) {
$origin = $this->file->getTmp();
// This will typically be /media/files
$uploadDir = realpath($this->coreParametersHelper->getParameter('upload_dir'));
$fileName ... | php | private function fileMove($overwrite = true)
{
if (!$this->file->getLocation() || $overwrite) {
$origin = $this->file->getTmp();
// This will typically be /media/files
$uploadDir = realpath($this->coreParametersHelper->getParameter('upload_dir'));
$fileName ... | [
"private",
"function",
"fileMove",
"(",
"$",
"overwrite",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"file",
"->",
"getLocation",
"(",
")",
"||",
"$",
"overwrite",
")",
"{",
"$",
"origin",
"=",
"$",
"this",
"->",
"file",
"->",
"getTm... | Moves the file out of temp, and locks the hashes.
@param bool $overwrite
@return $this
@throws ContactClientException | [
"Moves",
"the",
"file",
"out",
"of",
"temp",
"and",
"locks",
"the",
"hashes",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L1228-L1282 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.setEvent | public function setEvent($event = [])
{
if (!empty($event['id'])) {
$this->setLogs($event['id'], 'campaignEventId');
}
$overrides = [];
if (!empty($event['config']['contactclient_overrides'])) {
// Flatten overrides to key-value pairs.
$jsonHelper ... | php | public function setEvent($event = [])
{
if (!empty($event['id'])) {
$this->setLogs($event['id'], 'campaignEventId');
}
$overrides = [];
if (!empty($event['config']['contactclient_overrides'])) {
// Flatten overrides to key-value pairs.
$jsonHelper ... | [
"public",
"function",
"setEvent",
"(",
"$",
"event",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"event",
"[",
"'id'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"setLogs",
"(",
"$",
"event",
"[",
"'id'",
"]",
",",
"'campaignEventId'"... | @param array $event
@return $this
@throws \Exception | [
"@param",
"array",
"$event"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L1309-L1333 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.setOverrides | public function setOverrides($overrides)
{
$fieldsOverridden = [];
if (isset($this->payload->body)) {
foreach ($this->payload->body as &$field) {
if (
isset($field->overridable)
&& true === $field->overridable
&&... | php | public function setOverrides($overrides)
{
$fieldsOverridden = [];
if (isset($this->payload->body)) {
foreach ($this->payload->body as &$field) {
if (
isset($field->overridable)
&& true === $field->overridable
&&... | [
"public",
"function",
"setOverrides",
"(",
"$",
"overrides",
")",
"{",
"$",
"fieldsOverridden",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"payload",
"->",
"body",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"payload",
"->"... | Override the default field values, if allowed.
@param $overrides
@return $this | [
"Override",
"the",
"default",
"field",
"values",
"if",
"allowed",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L1342-L1364 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.fileSend | private function fileSend()
{
$attemptCount = 0;
$successCount = 0;
if (isset($this->payload->operations)) {
foreach ($this->payload->operations as $type => $operation) {
if (is_object($operation)) {
++$attemptCount;
$result... | php | private function fileSend()
{
$attemptCount = 0;
$successCount = 0;
if (isset($this->payload->operations)) {
foreach ($this->payload->operations as $type => $operation) {
if (is_object($operation)) {
++$attemptCount;
$result... | [
"private",
"function",
"fileSend",
"(",
")",
"{",
"$",
"attemptCount",
"=",
"0",
";",
"$",
"successCount",
"=",
"0",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"payload",
"->",
"operations",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"... | By cron/cli send appropriate files for this time. | [
"By",
"cron",
"/",
"cli",
"send",
"appropriate",
"files",
"for",
"this",
"time",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L1369-L1426 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.operationEmail | private function operationEmail($operation)
{
if ($this->test) {
$to = !empty($operation->test) ? $operation->test : (!empty($operation->to) ? $operation->to : '');
} else {
$to = !empty($operation->to) ? $operation->to : '';
}
if (!$to) {
$this->s... | php | private function operationEmail($operation)
{
if ($this->test) {
$to = !empty($operation->test) ? $operation->test : (!empty($operation->to) ? $operation->to : '');
} else {
$to = !empty($operation->to) ? $operation->to : '';
}
if (!$to) {
$this->s... | [
"private",
"function",
"operationEmail",
"(",
"$",
"operation",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"test",
")",
"{",
"$",
"to",
"=",
"!",
"empty",
"(",
"$",
"operation",
"->",
"test",
")",
"?",
"$",
"operation",
"->",
"test",
":",
"(",
"!",
... | Send an email containing the file to the current client by Email.
@param $operation
@return bool | [
"Send",
"an",
"email",
"containing",
"the",
"file",
"to",
"the",
"current",
"client",
"by",
"Email",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L1435-L1508 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.operationFtpConfig | private function operationFtpConfig($operation)
{
$config = [];
$config['host'] = isset($operation->host) ? trim($operation->host) : null;
if (!$config['host']) {
$this->setLogs('Host is required.', 'error');
return false;
} else {
// Remo... | php | private function operationFtpConfig($operation)
{
$config = [];
$config['host'] = isset($operation->host) ? trim($operation->host) : null;
if (!$config['host']) {
$this->setLogs('Host is required.', 'error');
return false;
} else {
// Remo... | [
"private",
"function",
"operationFtpConfig",
"(",
"$",
"operation",
")",
"{",
"$",
"config",
"=",
"[",
"]",
";",
"$",
"config",
"[",
"'host'",
"]",
"=",
"isset",
"(",
"$",
"operation",
"->",
"host",
")",
"?",
"trim",
"(",
"$",
"operation",
"->",
"hos... | Given the operation array, construct configuration array for a FTP/SFTP adaptor.
@param $operation
@return array|bool | [
"Given",
"the",
"operation",
"array",
"construct",
"configuration",
"array",
"for",
"a",
"FTP",
"/",
"SFTP",
"adaptor",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L1574-L1642 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.operationSftp | private function operationSftp($operation)
{
$config = $this->operationFtpConfig($operation);
$adapter = new SftpAdapter($config);
$filesystem = new Filesystem($adapter);
$written = false;
if ($stream = fopen($this->file->getLocation(), 'r+')) {
$this->setLog... | php | private function operationSftp($operation)
{
$config = $this->operationFtpConfig($operation);
$adapter = new SftpAdapter($config);
$filesystem = new Filesystem($adapter);
$written = false;
if ($stream = fopen($this->file->getLocation(), 'r+')) {
$this->setLog... | [
"private",
"function",
"operationSftp",
"(",
"$",
"operation",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"operationFtpConfig",
"(",
"$",
"operation",
")",
";",
"$",
"adapter",
"=",
"new",
"SftpAdapter",
"(",
"$",
"config",
")",
";",
"$",
"filesyst... | Upload the current client file by sFTP.
@param $operation
@return bool | [
"Upload",
"the",
"current",
"client",
"file",
"by",
"sFTP",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L1651-L1676 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.operationS3 | private function operationS3($operation)
{
$config = [];
$config['key'] = isset($operation->key) ? trim($operation->key) : null;
if (!$config['key']) {
$this->setLogs('Key is required.', 'error');
return false;
} else {
$this->setLogs($conf... | php | private function operationS3($operation)
{
$config = [];
$config['key'] = isset($operation->key) ? trim($operation->key) : null;
if (!$config['key']) {
$this->setLogs('Key is required.', 'error');
return false;
} else {
$this->setLogs($conf... | [
"private",
"function",
"operationS3",
"(",
"$",
"operation",
")",
"{",
"$",
"config",
"=",
"[",
"]",
";",
"$",
"config",
"[",
"'key'",
"]",
"=",
"isset",
"(",
"$",
"operation",
"->",
"key",
")",
"?",
"trim",
"(",
"$",
"operation",
"->",
"key",
")",... | @param $operation
@return bool | [
"@param",
"$operation"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L1683-L1753 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.setCampaign | public function setCampaign(Campaign $campaign = null)
{
if ($campaign) {
$this->setLogs($campaign->getId(), 'campaignId');
$this->campaign = $campaign;
}
return $this;
} | php | public function setCampaign(Campaign $campaign = null)
{
if ($campaign) {
$this->setLogs($campaign->getId(), 'campaignId');
$this->campaign = $campaign;
}
return $this;
} | [
"public",
"function",
"setCampaign",
"(",
"Campaign",
"$",
"campaign",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"campaign",
")",
"{",
"$",
"this",
"->",
"setLogs",
"(",
"$",
"campaign",
"->",
"getId",
"(",
")",
",",
"'campaignId'",
")",
";",
"$",
"this... | @param Campaign|null $campaign
@return $this | [
"@param",
"Campaign|null",
"$campaign"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L1788-L1796 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.getOverrides | public function getOverrides()
{
$result = [];
if (isset($this->payload->body)) {
foreach ($this->payload->body as $field) {
if (isset($field->overridable) && true === $field->overridable) {
// Remove irrelevant data, since this result will need to be ... | php | public function getOverrides()
{
$result = [];
if (isset($this->payload->body)) {
foreach ($this->payload->body as $field) {
if (isset($field->overridable) && true === $field->overridable) {
// Remove irrelevant data, since this result will need to be ... | [
"public",
"function",
"getOverrides",
"(",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"payload",
"->",
"body",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"payload",
"->",
"body",
"as",
"$",
"fi... | Retrieve from the payload all outgoing fields that are set to overridable.
@return array | [
"Retrieve",
"from",
"the",
"payload",
"all",
"outgoing",
"fields",
"that",
"are",
"set",
"to",
"overridable",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L1803-L1822 |
TheDMSGroup/mautic-contact-client | Model/FilePayload.php | FilePayload.getExternalId | public function getExternalId()
{
if ($this->file && $this->file->getCrc32()) {
return $this->file->getName().' ('.$this->file->getCrc32().')';
}
return null;
} | php | public function getExternalId()
{
if ($this->file && $this->file->getCrc32()) {
return $this->file->getName().' ('.$this->file->getCrc32().')';
}
return null;
} | [
"public",
"function",
"getExternalId",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"file",
"&&",
"$",
"this",
"->",
"file",
"->",
"getCrc32",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"file",
"->",
"getName",
"(",
")",
".",
"' ('",
".",
"... | Since there is no external ID when sending files, we'll include the file name and CRC check at creation.
@return null|string | [
"Since",
"there",
"is",
"no",
"external",
"ID",
"when",
"sending",
"files",
"we",
"ll",
"include",
"the",
"file",
"name",
"and",
"CRC",
"check",
"at",
"creation",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Model/FilePayload.php#L1829-L1836 |
TheDMSGroup/mautic-contact-client | Integration/ClientIntegration.php | ClientIntegration.pushLead | public function pushLead($contact, $event = [])
{
$this->reset();
$this->getEvent($event);
if (empty($this->event['config']['contactclient'])) {
return false;
}
/** @var Contact $contactModel */
$clientModel = $this->getContactClientModel();
$cli... | php | public function pushLead($contact, $event = [])
{
$this->reset();
$this->getEvent($event);
if (empty($this->event['config']['contactclient'])) {
return false;
}
/** @var Contact $contactModel */
$clientModel = $this->getContactClientModel();
$cli... | [
"public",
"function",
"pushLead",
"(",
"$",
"contact",
",",
"$",
"event",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"reset",
"(",
")",
";",
"$",
"this",
"->",
"getEvent",
"(",
"$",
"event",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"this",
"->"... | Push a contact to a preconfigured Contact Client.
@param Contact $contact
@param array $event
@return bool
@throws Exception | [
"Push",
"a",
"contact",
"to",
"a",
"preconfigured",
"Contact",
"Client",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Integration/ClientIntegration.php#L147-L165 |
TheDMSGroup/mautic-contact-client | Integration/ClientIntegration.php | ClientIntegration.getEvent | public function getEvent($event = [])
{
if (!$this->event) {
$this->event = $event;
if (isset($event['config'])
&& (empty($event['integration'])
|| (
!empty($event['integration'])
&& $event['integrati... | php | public function getEvent($event = [])
{
if (!$this->event) {
$this->event = $event;
if (isset($event['config'])
&& (empty($event['integration'])
|| (
!empty($event['integration'])
&& $event['integrati... | [
"public",
"function",
"getEvent",
"(",
"$",
"event",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"event",
")",
"{",
"$",
"this",
"->",
"event",
"=",
"$",
"event",
";",
"if",
"(",
"isset",
"(",
"$",
"event",
"[",
"'config'",
"]",... | Merges a config from integration_list with feature settings.
@param array $event to merge configuration
@return array|mixed | [
"Merges",
"a",
"config",
"from",
"integration_list",
"with",
"feature",
"settings",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Integration/ClientIntegration.php#L194-L246 |
TheDMSGroup/mautic-contact-client | Integration/ClientIntegration.php | ClientIntegration.getContactClientModel | private function getContactClientModel()
{
if (!$this->contactClientModel) {
/* @var ContactClientModel $contactClientModel */
$this->contactClientModel = $this->getContainer()->get('mautic.contactclient.model.contactclient');
}
return $this->contactClientModel;
... | php | private function getContactClientModel()
{
if (!$this->contactClientModel) {
/* @var ContactClientModel $contactClientModel */
$this->contactClientModel = $this->getContainer()->get('mautic.contactclient.model.contactclient');
}
return $this->contactClientModel;
... | [
"private",
"function",
"getContactClientModel",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"contactClientModel",
")",
"{",
"/* @var ContactClientModel $contactClientModel */",
"$",
"this",
"->",
"contactClientModel",
"=",
"$",
"this",
"->",
"getContainer",
"(... | @return ContactClientModel|object
@throws Exception | [
"@return",
"ContactClientModel|object"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Integration/ClientIntegration.php#L263-L271 |
TheDMSGroup/mautic-contact-client | Integration/ClientIntegration.php | ClientIntegration.sendContact | public function sendContact(
ContactClient $client = null,
Contact $contact = null,
$test = false,
$force = false
) {
if (!$this->translator) {
$this->translator = $this->getContainer()->get('translator');
}
$this->contactClient = $client;
... | php | public function sendContact(
ContactClient $client = null,
Contact $contact = null,
$test = false,
$force = false
) {
if (!$this->translator) {
$this->translator = $this->getContainer()->get('translator');
}
$this->contactClient = $client;
... | [
"public",
"function",
"sendContact",
"(",
"ContactClient",
"$",
"client",
"=",
"null",
",",
"Contact",
"$",
"contact",
"=",
"null",
",",
"$",
"test",
"=",
"false",
",",
"$",
"force",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"transla... | Given the JSON API API instructions payload instruction set.
Send the lead/contact to the API by following the steps.
@param ContactClient|null $client
@param Contact|null $contact
@param bool $test
@param bool $force
@return $this
@throws Exception | [
"Given",
"the",
"JSON",
"API",
"API",
"instructions",
"payload",
"instruction",
"set",
".",
"Send",
"the",
"lead",
"/",
"contact",
"to",
"the",
"API",
"by",
"following",
"the",
"steps",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Integration/ClientIntegration.php#L298-L375 |
TheDMSGroup/mautic-contact-client | Integration/ClientIntegration.php | ClientIntegration.validateClient | private function validateClient(ContactClient $client = null, $force = false)
{
if (!$client && !$this->test) {
throw new ContactClientException(
$this->translator->trans('mautic.contactclient.sendcontact.error.client.load'),
0,
null,
... | php | private function validateClient(ContactClient $client = null, $force = false)
{
if (!$client && !$this->test) {
throw new ContactClientException(
$this->translator->trans('mautic.contactclient.sendcontact.error.client.load'),
0,
null,
... | [
"private",
"function",
"validateClient",
"(",
"ContactClient",
"$",
"client",
"=",
"null",
",",
"$",
"force",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"client",
"&&",
"!",
"$",
"this",
"->",
"test",
")",
"{",
"throw",
"new",
"ContactClientException",... | @param ContactClient|null $client
@param bool $force
@throws ContactClientException | [
"@param",
"ContactClient|null",
"$client",
"@param",
"bool",
"$force"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Integration/ClientIntegration.php#L383-L403 |
TheDMSGroup/mautic-contact-client | Integration/ClientIntegration.php | ClientIntegration.getPayloadModel | private function getPayloadModel(ContactClient $contactClient = null)
{
if (!$this->payloadModel || $contactClient) {
$contactClient = $contactClient ? $contactClient : $this->contactClient;
$clientType = $contactClient->getType();
if ('api' == $clientType) {
... | php | private function getPayloadModel(ContactClient $contactClient = null)
{
if (!$this->payloadModel || $contactClient) {
$contactClient = $contactClient ? $contactClient : $this->contactClient;
$clientType = $contactClient->getType();
if ('api' == $clientType) {
... | [
"private",
"function",
"getPayloadModel",
"(",
"ContactClient",
"$",
"contactClient",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"payloadModel",
"||",
"$",
"contactClient",
")",
"{",
"$",
"contactClient",
"=",
"$",
"contactClient",
"?",
"$",
... | Get the current Payload model, or the model of a particular client.
@param ContactClient|null $contactClient
@return ApiPayload|FilePayload|object
@throws ContactClientException | [
"Get",
"the",
"current",
"Payload",
"model",
"or",
"the",
"model",
"of",
"a",
"particular",
"client",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Integration/ClientIntegration.php#L459-L481 |
TheDMSGroup/mautic-contact-client | Integration/ClientIntegration.php | ClientIntegration.getApiPayloadModel | private function getApiPayloadModel()
{
if (!$this->apiPayloadModel) {
/* @var ApiPayload apiPayloadModel */
$this->apiPayloadModel = $this->getContainer()->get('mautic.contactclient.model.apipayload');
}
return $this->apiPayloadModel;
} | php | private function getApiPayloadModel()
{
if (!$this->apiPayloadModel) {
/* @var ApiPayload apiPayloadModel */
$this->apiPayloadModel = $this->getContainer()->get('mautic.contactclient.model.apipayload');
}
return $this->apiPayloadModel;
} | [
"private",
"function",
"getApiPayloadModel",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"apiPayloadModel",
")",
"{",
"/* @var ApiPayload apiPayloadModel */",
"$",
"this",
"->",
"apiPayloadModel",
"=",
"$",
"this",
"->",
"getContainer",
"(",
")",
"->",
"... | @return ApiPayload|object
@throws Exception | [
"@return",
"ApiPayload|object"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Integration/ClientIntegration.php#L488-L496 |
TheDMSGroup/mautic-contact-client | Integration/ClientIntegration.php | ClientIntegration.getFilePayloadModel | private function getFilePayloadModel()
{
if (!$this->filePayloadModel) {
/* @var FilePayload filePayloadModel */
$this->filePayloadModel = $this->getContainer()->get('mautic.contactclient.model.filepayload');
}
return $this->filePayloadModel;
} | php | private function getFilePayloadModel()
{
if (!$this->filePayloadModel) {
/* @var FilePayload filePayloadModel */
$this->filePayloadModel = $this->getContainer()->get('mautic.contactclient.model.filepayload');
}
return $this->filePayloadModel;
} | [
"private",
"function",
"getFilePayloadModel",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"filePayloadModel",
")",
"{",
"/* @var FilePayload filePayloadModel */",
"$",
"this",
"->",
"filePayloadModel",
"=",
"$",
"this",
"->",
"getContainer",
"(",
")",
"->"... | @return FilePayload|object
@throws Exception | [
"@return",
"FilePayload|object"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Integration/ClientIntegration.php#L503-L511 |
TheDMSGroup/mautic-contact-client | Integration/ClientIntegration.php | ClientIntegration.evaluateFilter | private function evaluateFilter()
{
if ($this->test) {
return $this;
}
$definition = $this->contactClient->getFilter();
if ($definition) {
// Succeed by default should there be no rules.
$filterResult = true;
$filter = new FilterH... | php | private function evaluateFilter()
{
if ($this->test) {
return $this;
}
$definition = $this->contactClient->getFilter();
if ($definition) {
// Succeed by default should there be no rules.
$filterResult = true;
$filter = new FilterH... | [
"private",
"function",
"evaluateFilter",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"test",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
"definition",
"=",
"$",
"this",
"->",
"contactClient",
"->",
"getFilter",
"(",
")",
";",
"if",
"(",
"$",
"... | @return $this
@throws ContactClientException | [
"@return",
"$this"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Integration/ClientIntegration.php#L518-L559 |
TheDMSGroup/mautic-contact-client | Integration/ClientIntegration.php | ClientIntegration.evaluateDnc | private function evaluateDnc()
{
if ($this->test) {
return $this;
}
$channels = explode(',', $this->contactClient->getDncChecks());
if ($channels) {
foreach ($channels as $channel) {
$dncRepo = $this->getDncRepo();
$dncRepo->set... | php | private function evaluateDnc()
{
if ($this->test) {
return $this;
}
$channels = explode(',', $this->contactClient->getDncChecks());
if ($channels) {
foreach ($channels as $channel) {
$dncRepo = $this->getDncRepo();
$dncRepo->set... | [
"private",
"function",
"evaluateDnc",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"test",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
"channels",
"=",
"explode",
"(",
"','",
",",
"$",
"this",
"->",
"contactClient",
"->",
"getDncChecks",
"(",
")"... | Evaluates the DNC entries for the Contact against the Client settings.
@return $this
@throws ContactClientException | [
"Evaluates",
"the",
"DNC",
"entries",
"for",
"the",
"Contact",
"against",
"the",
"Client",
"settings",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Integration/ClientIntegration.php#L568-L614 |
TheDMSGroup/mautic-contact-client | Integration/ClientIntegration.php | ClientIntegration.getDncChannelName | private function getDncChannelName($key)
{
if (!$this->dncChannels) {
$this->dncChannels = $this->getContactModel()->getPreferenceChannels();
}
if ($key) {
if (isset($this->dncChannels[$key])) {
return $this->dncChannels[$key];
} else {
... | php | private function getDncChannelName($key)
{
if (!$this->dncChannels) {
$this->dncChannels = $this->getContactModel()->getPreferenceChannels();
}
if ($key) {
if (isset($this->dncChannels[$key])) {
return $this->dncChannels[$key];
} else {
... | [
"private",
"function",
"getDncChannelName",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"dncChannels",
")",
"{",
"$",
"this",
"->",
"dncChannels",
"=",
"$",
"this",
"->",
"getContactModel",
"(",
")",
"->",
"getPreferenceChannels",
"(",
... | Get all DNC Channels, or one by key.
@param $key
@return array|mixed | [
"Get",
"all",
"DNC",
"Channels",
"or",
"one",
"by",
"key",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Integration/ClientIntegration.php#L635-L649 |
TheDMSGroup/mautic-contact-client | Integration/ClientIntegration.php | ClientIntegration.getCacheModel | private function getCacheModel()
{
if (!$this->cacheModel) {
/* @var \MauticPlugin\MauticContactClientBundle\Model\Cache $cacheModel */
$this->cacheModel = $this->getContainer()->get('mautic.contactclient.model.cache');
$this->cacheModel->setContact($this->contact);
... | php | private function getCacheModel()
{
if (!$this->cacheModel) {
/* @var \MauticPlugin\MauticContactClientBundle\Model\Cache $cacheModel */
$this->cacheModel = $this->getContainer()->get('mautic.contactclient.model.cache');
$this->cacheModel->setContact($this->contact);
... | [
"private",
"function",
"getCacheModel",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"cacheModel",
")",
"{",
"/* @var \\MauticPlugin\\MauticContactClientBundle\\Model\\Cache $cacheModel */",
"$",
"this",
"->",
"cacheModel",
"=",
"$",
"this",
"->",
"getContainer",... | Get the Cache model for duplicate/exclusive/limit checking.
@return \MauticPlugin\MauticContactClientBundle\Model\Cache
@throws Exception | [
"Get",
"the",
"Cache",
"model",
"for",
"duplicate",
"/",
"exclusive",
"/",
"limit",
"checking",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Integration/ClientIntegration.php#L670-L681 |
TheDMSGroup/mautic-contact-client | Integration/ClientIntegration.php | ClientIntegration.getCampaign | private function getCampaign()
{
if (!$this->campaign && $this->event) {
// Sometimes we have a campaignId as an integer ID.
if (!empty($this->event['campaignId']) && is_integer($this->event['campaignId'])) {
/** @var CampaignModel $campaignModel */
$c... | php | private function getCampaign()
{
if (!$this->campaign && $this->event) {
// Sometimes we have a campaignId as an integer ID.
if (!empty($this->event['campaignId']) && is_integer($this->event['campaignId'])) {
/** @var CampaignModel $campaignModel */
$c... | [
"private",
"function",
"getCampaign",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"campaign",
"&&",
"$",
"this",
"->",
"event",
")",
"{",
"// Sometimes we have a campaignId as an integer ID.",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"event",
... | Attempt to discern if we are being triggered by/within a campaign.
@return \Mautic\CampaignBundle\Entity\Campaign|mixed|null
@throws Exception | [
"Attempt",
"to",
"discern",
"if",
"we",
"are",
"being",
"triggered",
"by",
"/",
"within",
"a",
"campaign",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Integration/ClientIntegration.php#L690-L716 |
TheDMSGroup/mautic-contact-client | Integration/ClientIntegration.php | ClientIntegration.handleException | private function handleException(\Exception $exception)
{
// Any exception means the client send has failed.
$this->valid = false;
if ($exception instanceof ContactClientException) {
// A known exception within the Client handling.
if ($this->contact) {
... | php | private function handleException(\Exception $exception)
{
// Any exception means the client send has failed.
$this->valid = false;
if ($exception instanceof ContactClientException) {
// A known exception within the Client handling.
if ($this->contact) {
... | [
"private",
"function",
"handleException",
"(",
"\\",
"Exception",
"$",
"exception",
")",
"{",
"// Any exception means the client send has failed.",
"$",
"this",
"->",
"valid",
"=",
"false",
";",
"if",
"(",
"$",
"exception",
"instanceof",
"ContactClientException",
")",... | @param Exception $exception
@throws ContactClientException | [
"@param",
"Exception",
"$exception"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Integration/ClientIntegration.php#L723-L828 |
TheDMSGroup/mautic-contact-client | Integration/ClientIntegration.php | ClientIntegration.addRescheduleItemToSession | public function addRescheduleItemToSession($startDay = 1, $endDay = 7, \DateTime $startTime = null, $reason = null)
{
$result = false;
if (isset($this->getEvent()['leadEventLog'])) {
// To randomly disperse API requests we must get all openings within the date range first.
$a... | php | public function addRescheduleItemToSession($startDay = 1, $endDay = 7, \DateTime $startTime = null, $reason = null)
{
$result = false;
if (isset($this->getEvent()['leadEventLog'])) {
// To randomly disperse API requests we must get all openings within the date range first.
$a... | [
"public",
"function",
"addRescheduleItemToSession",
"(",
"$",
"startDay",
"=",
"1",
",",
"$",
"endDay",
"=",
"7",
",",
"\\",
"DateTime",
"$",
"startTime",
"=",
"null",
",",
"$",
"reason",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"false",
";",
"if",
... | @param int $startDay
@param int $endDay
@param \DateTime|null $startTime
@param string|null $reason
@return bool
@throws Exception | [
"@param",
"int",
"$startDay",
"@param",
"int",
"$endDay",
"@param",
"\\",
"DateTime|null",
"$startTime",
"@param",
"string|null",
"$reason"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Integration/ClientIntegration.php#L840-L883 |
TheDMSGroup/mautic-contact-client | Integration/ClientIntegration.php | ClientIntegration.updateContact | private function updateContact()
{
// Assume no attribution till calculated.
$this->attribution = 0;
// Do not update contacts for test runs.
if ($this->test || !$this->payloadModel) {
return;
}
// Only update contacts if success definitions are met.
... | php | private function updateContact()
{
// Assume no attribution till calculated.
$this->attribution = 0;
// Do not update contacts for test runs.
if ($this->test || !$this->payloadModel) {
return;
}
// Only update contacts if success definitions are met.
... | [
"private",
"function",
"updateContact",
"(",
")",
"{",
"// Assume no attribution till calculated.",
"$",
"this",
"->",
"attribution",
"=",
"0",
";",
"// Do not update contacts for test runs.",
"if",
"(",
"$",
"this",
"->",
"test",
"||",
"!",
"$",
"this",
"->",
"pa... | Loop through the API Operation responses and find valid field mappings.
Set the new values to the contact and log the changes thereof. | [
"Loop",
"through",
"the",
"API",
"Operation",
"responses",
"and",
"find",
"valid",
"field",
"mappings",
".",
"Set",
"the",
"new",
"values",
"to",
"the",
"contact",
"and",
"log",
"the",
"changes",
"thereof",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Integration/ClientIntegration.php#L914-L974 |
TheDMSGroup/mautic-contact-client | Integration/ClientIntegration.php | ClientIntegration.dispatchContextCreate | private function dispatchContextCreate()
{
if ($this->test || !$this->payloadModel) {
return;
}
$campaign = $this->getCampaign();
$event = new ContactLedgerContextEvent(
$campaign, $this->contactClient, $this->statType, '0 Revenue conversion', $this->conta... | php | private function dispatchContextCreate()
{
if ($this->test || !$this->payloadModel) {
return;
}
$campaign = $this->getCampaign();
$event = new ContactLedgerContextEvent(
$campaign, $this->contactClient, $this->statType, '0 Revenue conversion', $this->conta... | [
"private",
"function",
"dispatchContextCreate",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"test",
"||",
"!",
"$",
"this",
"->",
"payloadModel",
")",
"{",
"return",
";",
"}",
"$",
"campaign",
"=",
"$",
"this",
"->",
"getCampaign",
"(",
")",
";",
"$... | Provide context to Ledger plugin (or others) about this contact for save events. | [
"Provide",
"context",
"to",
"Ledger",
"plugin",
"(",
"or",
"others",
")",
"about",
"this",
"contact",
"for",
"save",
"events",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Integration/ClientIntegration.php#L979-L993 |
TheDMSGroup/mautic-contact-client | Integration/ClientIntegration.php | ClientIntegration.dispatchContextCapture | private function dispatchContextCapture()
{
if ($this->test || !$this->valid || !$this->payloadModel || Stat::TYPE_CONVERTED !== $this->statType) {
return;
}
$campaign = $this->getCampaign();
$event = new ContactLedgerContextEvent(
$campaign, $this->contac... | php | private function dispatchContextCapture()
{
if ($this->test || !$this->valid || !$this->payloadModel || Stat::TYPE_CONVERTED !== $this->statType) {
return;
}
$campaign = $this->getCampaign();
$event = new ContactLedgerContextEvent(
$campaign, $this->contac... | [
"private",
"function",
"dispatchContextCapture",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"test",
"||",
"!",
"$",
"this",
"->",
"valid",
"||",
"!",
"$",
"this",
"->",
"payloadModel",
"||",
"Stat",
"::",
"TYPE_CONVERTED",
"!==",
"$",
"this",
"->",
"... | For situations where there is no entity saved, but we still need to log a conversion. | [
"For",
"situations",
"where",
"there",
"is",
"no",
"entity",
"saved",
"but",
"we",
"still",
"need",
"to",
"log",
"a",
"conversion",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Integration/ClientIntegration.php#L998-L1012 |
TheDMSGroup/mautic-contact-client | Integration/ClientIntegration.php | ClientIntegration.createCache | private function createCache()
{
if (!$this->test && $this->valid) {
try {
$this->getCacheModel()->create();
} catch (Exception $e) {
// Do not log this as an error, because the contact was sent successfully.
$this->setLogs(
... | php | private function createCache()
{
if (!$this->test && $this->valid) {
try {
$this->getCacheModel()->create();
} catch (Exception $e) {
// Do not log this as an error, because the contact was sent successfully.
$this->setLogs(
... | [
"private",
"function",
"createCache",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"test",
"&&",
"$",
"this",
"->",
"valid",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"getCacheModel",
"(",
")",
"->",
"create",
"(",
")",
";",
"}",
"catch",
"("... | If all went well, and a contact was sent, create a cache entity for later correlation on exclusive/duplicate/
limit rules. | [
"If",
"all",
"went",
"well",
"and",
"a",
"contact",
"was",
"sent",
"create",
"a",
"cache",
"entity",
"for",
"later",
"correlation",
"on",
"exclusive",
"/",
"duplicate",
"/",
"limit",
"rules",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Integration/ClientIntegration.php#L1018-L1031 |
TheDMSGroup/mautic-contact-client | Integration/ClientIntegration.php | ClientIntegration.logResults | private function logResults()
{
// Do not log the results of a test?
if ($this->test) {
return;
}
$integrationEntityId = !empty($this->payloadModel) ? $this->payloadModel->getExternalId() : null;
/** @var contactClientModel $clientModel */
$clientModel = ... | php | private function logResults()
{
// Do not log the results of a test?
if ($this->test) {
return;
}
$integrationEntityId = !empty($this->payloadModel) ? $this->payloadModel->getExternalId() : null;
/** @var contactClientModel $clientModel */
$clientModel = ... | [
"private",
"function",
"logResults",
"(",
")",
"{",
"// Do not log the results of a test?",
"if",
"(",
"$",
"this",
"->",
"test",
")",
"{",
"return",
";",
"}",
"$",
"integrationEntityId",
"=",
"!",
"empty",
"(",
"$",
"this",
"->",
"payloadModel",
")",
"?",
... | Log to:
contactclient_stats
contactclient_events
integration_entity. | [
"Log",
"to",
":",
"contactclient_stats",
"contactclient_events",
"integration_entity",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Integration/ClientIntegration.php#L1039-L1161 |
TheDMSGroup/mautic-contact-client | Integration/ClientIntegration.php | ClientIntegration.getLogs | public function getLogs($key = '')
{
if ($key) {
if (isset($this->logs[$key])) {
if (!is_array($this->logs[$key])) {
return [$this->logs[$key]];
} else {
return $this->logs[$key];
}
} else {
... | php | public function getLogs($key = '')
{
if ($key) {
if (isset($this->logs[$key])) {
if (!is_array($this->logs[$key])) {
return [$this->logs[$key]];
} else {
return $this->logs[$key];
}
} else {
... | [
"public",
"function",
"getLogs",
"(",
"$",
"key",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"logs",
"[",
"$",
"key",
"]",
")",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"this",
"... | @param string $key
@return array|mixed|null | [
"@param",
"string",
"$key"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Integration/ClientIntegration.php#L1168-L1183 |
TheDMSGroup/mautic-contact-client | Integration/ClientIntegration.php | ClientIntegration.appendToForm | public function appendToForm(&$builder, $data, $formArea)
{
if ('integration' == $formArea) {
if ($this->isAuthorized()) {
/** @var contactClientModel $clientModel */
$clientModel = $this->getContactClientModel();
/** @var contactClientRepository ... | php | public function appendToForm(&$builder, $data, $formArea)
{
if ('integration' == $formArea) {
if ($this->isAuthorized()) {
/** @var contactClientModel $clientModel */
$clientModel = $this->getContactClientModel();
/** @var contactClientRepository ... | [
"public",
"function",
"appendToForm",
"(",
"&",
"$",
"builder",
",",
"$",
"data",
",",
"$",
"formArea",
")",
"{",
"if",
"(",
"'integration'",
"==",
"$",
"formArea",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isAuthorized",
"(",
")",
")",
"{",
"/** @var... | @param \Symfony\Component\Form\FormBuilder $builder
@param array $data
@param string $formArea
@throws Exception | [
"@param",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"Form",
"\\",
"FormBuilder",
"$builder",
"@param",
"array",
"$data",
"@param",
"string",
"$formArea"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Integration/ClientIntegration.php#L1267-L1442 |
TheDMSGroup/mautic-contact-client | Helper/JSONHelper.php | JSONHelper.decodeArray | public function decodeArray($string, $fieldName = null, $assoc = false)
{
if (empty($string)) {
return [];
}
$array = self::decode($string, $fieldName, $assoc);
if (is_string($array)) {
$array = self::decode($array, $fieldName, $assoc);
}
if (!... | php | public function decodeArray($string, $fieldName = null, $assoc = false)
{
if (empty($string)) {
return [];
}
$array = self::decode($string, $fieldName, $assoc);
if (is_string($array)) {
$array = self::decode($array, $fieldName, $assoc);
}
if (!... | [
"public",
"function",
"decodeArray",
"(",
"$",
"string",
",",
"$",
"fieldName",
"=",
"null",
",",
"$",
"assoc",
"=",
"false",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"string",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"array",
"=",
"self"... | @param $string
@param string $fieldName
@param bool $assoc
@return mixed
@throws \Exception | [
"@param",
"$string",
"@param",
"string",
"$fieldName",
"@param",
"bool",
"$assoc"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Helper/JSONHelper.php#L28-L42 |
TheDMSGroup/mautic-contact-client | Helper/JSONHelper.php | JSONHelper.decode | private function decode($string, $fieldName, $assoc = false)
{
$jsonError = false;
$result = json_decode($string, $assoc);
switch (json_last_error()) {
case JSON_ERROR_NONE:
break;
case JSON_ERROR_DEPTH:
$jsonError = 'Maximum stack d... | php | private function decode($string, $fieldName, $assoc = false)
{
$jsonError = false;
$result = json_decode($string, $assoc);
switch (json_last_error()) {
case JSON_ERROR_NONE:
break;
case JSON_ERROR_DEPTH:
$jsonError = 'Maximum stack d... | [
"private",
"function",
"decode",
"(",
"$",
"string",
",",
"$",
"fieldName",
",",
"$",
"assoc",
"=",
"false",
")",
"{",
"$",
"jsonError",
"=",
"false",
";",
"$",
"result",
"=",
"json_decode",
"(",
"$",
"string",
",",
"$",
"assoc",
")",
";",
"switch",
... | @param $string
@param $fieldName
@param bool $assoc
@return mixed
@throws \Exception | [
"@param",
"$string",
"@param",
"$fieldName",
"@param",
"bool",
"$assoc"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Helper/JSONHelper.php#L53-L84 |
TheDMSGroup/mautic-contact-client | Helper/JSONHelper.php | JSONHelper.decodeObject | public function decodeObject($string, $fieldName = null)
{
if (empty($string)) {
return new \stdClass();
}
$object = self::decode($string, $fieldName);
if (is_string($object)) {
$object = self::decode($object, $fieldName);
}
if (!is_object($obj... | php | public function decodeObject($string, $fieldName = null)
{
if (empty($string)) {
return new \stdClass();
}
$object = self::decode($string, $fieldName);
if (is_string($object)) {
$object = self::decode($object, $fieldName);
}
if (!is_object($obj... | [
"public",
"function",
"decodeObject",
"(",
"$",
"string",
",",
"$",
"fieldName",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"string",
")",
")",
"{",
"return",
"new",
"\\",
"stdClass",
"(",
")",
";",
"}",
"$",
"object",
"=",
"self",
"::",
... | @param $string
@param string $fieldName
@return mixed
@throws \Exception | [
"@param",
"$string",
"@param",
"string",
"$fieldName"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Helper/JSONHelper.php#L94-L108 |
TheDMSGroup/mautic-contact-client | Helper/JSONHelper.php | JSONHelper.encode | public function encode($mixed, $fieldName)
{
$jsonError = false;
self::utf8_encode($mixed);
$result = json_encode(
$mixed,
JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_PRETTY_PRINT
);
switch (json_last_error()) {
case ... | php | public function encode($mixed, $fieldName)
{
$jsonError = false;
self::utf8_encode($mixed);
$result = json_encode(
$mixed,
JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_PRETTY_PRINT
);
switch (json_last_error()) {
case ... | [
"public",
"function",
"encode",
"(",
"$",
"mixed",
",",
"$",
"fieldName",
")",
"{",
"$",
"jsonError",
"=",
"false",
";",
"self",
"::",
"utf8_encode",
"(",
"$",
"mixed",
")",
";",
"$",
"result",
"=",
"json_encode",
"(",
"$",
"mixed",
",",
"JSON_HEX_TAG"... | @param $mixed
@param $fieldName
@return false|string
@throws \Exception | [
"@param",
"$mixed",
"@param",
"$fieldName"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Helper/JSONHelper.php#L118-L153 |
TheDMSGroup/mautic-contact-client | Helper/JSONHelper.php | JSONHelper.utf8_encode | private static function utf8_encode(&$mixed)
{
if (is_array($mixed) || is_object($mixed)) {
foreach ($mixed as &$value) {
self::utf8_encode($value);
}
} else {
if (is_string($mixed)) {
$mixed = utf8_encode($mixed);
}
... | php | private static function utf8_encode(&$mixed)
{
if (is_array($mixed) || is_object($mixed)) {
foreach ($mixed as &$value) {
self::utf8_encode($value);
}
} else {
if (is_string($mixed)) {
$mixed = utf8_encode($mixed);
}
... | [
"private",
"static",
"function",
"utf8_encode",
"(",
"&",
"$",
"mixed",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"mixed",
")",
"||",
"is_object",
"(",
"$",
"mixed",
")",
")",
"{",
"foreach",
"(",
"$",
"mixed",
"as",
"&",
"$",
"value",
")",
"{",
... | Recursively encode via UTF8.
@param $mixed | [
"Recursively",
"encode",
"via",
"UTF8",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Helper/JSONHelper.php#L160-L171 |
TheDMSGroup/mautic-contact-client | Entity/AuthRepository.php | AuthRepository.getPreviousPayloadAuthTokensByContactClient | public function getPreviousPayloadAuthTokensByContactClient($contactClientId, $operationId = null, $test = false)
{
$result = [];
$q = $this->getEntityManager()->getConnection()->createQueryBuilder();
$q->select('a.operation, a.type, a.field, a.val')
->from(MAUTIC_TABLE_PREF... | php | public function getPreviousPayloadAuthTokensByContactClient($contactClientId, $operationId = null, $test = false)
{
$result = [];
$q = $this->getEntityManager()->getConnection()->createQueryBuilder();
$q->select('a.operation, a.type, a.field, a.val')
->from(MAUTIC_TABLE_PREF... | [
"public",
"function",
"getPreviousPayloadAuthTokensByContactClient",
"(",
"$",
"contactClientId",
",",
"$",
"operationId",
"=",
"null",
",",
"$",
"test",
"=",
"false",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"q",
"=",
"$",
"this",
"->",
"getEntit... | Gets all token key-value pairs for a contactClient that were previously captured by succesful
auth requests and persisted for re-use.
@param $contactClientId
@param $operationId
@param bool $test
@return array | [
"Gets",
"all",
"token",
"key",
"-",
"value",
"pairs",
"for",
"a",
"contactClient",
"that",
"were",
"previously",
"captured",
"by",
"succesful",
"auth",
"requests",
"and",
"persisted",
"for",
"re",
"-",
"use",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Entity/AuthRepository.php#L31-L54 |
TheDMSGroup/mautic-contact-client | Entity/AuthRepository.php | AuthRepository.flushPreviousAuthTokens | public function flushPreviousAuthTokens($contactClientId, $operationId, $test)
{
$q = $this->createQueryBuilder('a');
$q->delete()
->where(
$q->expr()->eq('a.contactClient', (int) $contactClientId),
$q->expr()->eq('a.operation', (int) $operationId),
... | php | public function flushPreviousAuthTokens($contactClientId, $operationId, $test)
{
$q = $this->createQueryBuilder('a');
$q->delete()
->where(
$q->expr()->eq('a.contactClient', (int) $contactClientId),
$q->expr()->eq('a.operation', (int) $operationId),
... | [
"public",
"function",
"flushPreviousAuthTokens",
"(",
"$",
"contactClientId",
",",
"$",
"operationId",
",",
"$",
"test",
")",
"{",
"$",
"q",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'a'",
")",
";",
"$",
"q",
"->",
"delete",
"(",
")",
"->",
"... | @param $contactClientId
@param $operationId
@param bool $test
@return array | [
"@param",
"$contactClientId",
"@param",
"$operationId",
"@param",
"bool",
"$test"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Entity/AuthRepository.php#L63-L74 |
TheDMSGroup/mautic-contact-client | Controller/AjaxController.php | AjaxController.transactionsAction | public function transactionsAction(Request $request)
{
$dataArray = [
'html' => '',
'success' => 0,
];
$filters = null;
// filters means the transaction table had a column sort or filter submission or pagination, otherwise its a fresh page load
if ... | php | public function transactionsAction(Request $request)
{
$dataArray = [
'html' => '',
'success' => 0,
];
$filters = null;
// filters means the transaction table had a column sort or filter submission or pagination, otherwise its a fresh page load
if ... | [
"public",
"function",
"transactionsAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"dataArray",
"=",
"[",
"'html'",
"=>",
"''",
",",
"'success'",
"=>",
"0",
",",
"]",
";",
"$",
"filters",
"=",
"null",
";",
"// filters means the transaction table had a ... | @param Request $request
@return \Symfony\Component\HttpFoundation\JsonResponse
@throws \Exception | [
"@param",
"Request",
"$request"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Controller/AjaxController.php#L42-L101 |
TheDMSGroup/mautic-contact-client | Controller/AjaxController.php | AjaxController.getTokensAction | protected function getTokensAction(Request $request)
{
// Get an array representation of the current payload (of last save) for context.
// No longer needs filePayload.
$payload = html_entity_decode(InputHelper::clean($request->request->get('apiPayload')));
$defaultFile = __DIR__... | php | protected function getTokensAction(Request $request)
{
// Get an array representation of the current payload (of last save) for context.
// No longer needs filePayload.
$payload = html_entity_decode(InputHelper::clean($request->request->get('apiPayload')));
$defaultFile = __DIR__... | [
"protected",
"function",
"getTokensAction",
"(",
"Request",
"$",
"request",
")",
"{",
"// Get an array representation of the current payload (of last save) for context.",
"// No longer needs filePayload.",
"$",
"payload",
"=",
"html_entity_decode",
"(",
"InputHelper",
"::",
"clea... | @param Request $request
@return \Symfony\Component\HttpFoundation\JsonResponse
@throws \Exception | [
"@param",
"Request",
"$request"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Controller/AjaxController.php#L212-L299 |
TheDMSGroup/mautic-contact-client | Services/Transport.php | Transport.setSettings | public function setSettings($settings = [])
{
$original = $this->settings;
$this->mergeSettings($settings, $this->settings);
if ($this->settings != $original) {
// @todo - Log Curl equivalent during test mode (adds overhead and risk so only do it during test)
// if (!... | php | public function setSettings($settings = [])
{
$original = $this->settings;
$this->mergeSettings($settings, $this->settings);
if ($this->settings != $original) {
// @todo - Log Curl equivalent during test mode (adds overhead and risk so only do it during test)
// if (!... | [
"public",
"function",
"setSettings",
"(",
"$",
"settings",
"=",
"[",
"]",
")",
"{",
"$",
"original",
"=",
"$",
"this",
"->",
"settings",
";",
"$",
"this",
"->",
"mergeSettings",
"(",
"$",
"settings",
",",
"$",
"this",
"->",
"settings",
")",
";",
"if"... | Establish a new Transport with the options provided if needed.
Only options that match the keys of our defaults are to be supported.
@param array $settings | [
"Establish",
"a",
"new",
"Transport",
"with",
"the",
"options",
"provided",
"if",
"needed",
".",
"Only",
"options",
"that",
"match",
"the",
"keys",
"of",
"our",
"defaults",
"are",
"to",
"be",
"supported",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Services/Transport.php#L86-L105 |
TheDMSGroup/mautic-contact-client | Services/Transport.php | Transport.mergeSettings | private function mergeSettings($settingsa, &$settingsb)
{
foreach ($settingsb as $key => &$value) {
if (isset($settingsa[$key])) {
if (is_array($value)) {
$this->mergeSettings($settingsa[$key], $value);
} else {
$value = $se... | php | private function mergeSettings($settingsa, &$settingsb)
{
foreach ($settingsb as $key => &$value) {
if (isset($settingsa[$key])) {
if (is_array($value)) {
$this->mergeSettings($settingsa[$key], $value);
} else {
$value = $se... | [
"private",
"function",
"mergeSettings",
"(",
"$",
"settingsa",
",",
"&",
"$",
"settingsb",
")",
"{",
"foreach",
"(",
"$",
"settingsb",
"as",
"$",
"key",
"=>",
"&",
"$",
"value",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"settingsa",
"[",
"$",
"key",
... | Merge settings from an external source overriding internals by a nested array.
@param array $settingsa
@param array $settingsb | [
"Merge",
"settings",
"from",
"an",
"external",
"source",
"overriding",
"internals",
"by",
"a",
"nested",
"array",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Services/Transport.php#L113-L124 |
TheDMSGroup/mautic-contact-client | MauticContactClientBundle.php | MauticContactClientBundle.onPluginUpdate | public static function onPluginUpdate(
Plugin $plugin,
MauticFactory $factory,
$metadata = null,
Schema $installedSchema = null
) {
// By default this is disabled, but for this plugin doctrine updates the schema faithfully.
self::updatePluginSchema($metadata, $install... | php | public static function onPluginUpdate(
Plugin $plugin,
MauticFactory $factory,
$metadata = null,
Schema $installedSchema = null
) {
// By default this is disabled, but for this plugin doctrine updates the schema faithfully.
self::updatePluginSchema($metadata, $install... | [
"public",
"static",
"function",
"onPluginUpdate",
"(",
"Plugin",
"$",
"plugin",
",",
"MauticFactory",
"$",
"factory",
",",
"$",
"metadata",
"=",
"null",
",",
"Schema",
"$",
"installedSchema",
"=",
"null",
")",
"{",
"// By default this is disabled, but for this plugi... | Called by PluginController::reloadAction when the addon version does not match what's installed.
@param Plugin $plugin
@param MauticFactory $factory
@param null $metadata
@param Schema $installedSchema
@throws \Exception | [
"Called",
"by",
"PluginController",
"::",
"reloadAction",
"when",
"the",
"addon",
"version",
"does",
"not",
"match",
"what",
"s",
"installed",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/MauticContactClientBundle.php#L31-L39 |
TheDMSGroup/mautic-contact-client | Controller/ContactClientDetailsTrait.php | ContactClientDetailsTrait.sanitizeEventFilter | public function sanitizeEventFilter($filters)
{
if (!is_array($filters)) {
throw new \InvalidArgumentException('filters parameter must be an array');
}
if (!isset($filters['search'])) {
$filters['search'] = '';
}
if (!isset($filters['includeEvents'])... | php | public function sanitizeEventFilter($filters)
{
if (!is_array($filters)) {
throw new \InvalidArgumentException('filters parameter must be an array');
}
if (!isset($filters['search'])) {
$filters['search'] = '';
}
if (!isset($filters['includeEvents'])... | [
"public",
"function",
"sanitizeEventFilter",
"(",
"$",
"filters",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"filters",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'filters parameter must be an array'",
")",
";",
"}",
"if",
"(",... | Makes sure that the event filter array is in the right format.
@param mixed $filters
@return array
@throws \InvalidArgumentException if not an array | [
"Makes",
"sure",
"that",
"the",
"event",
"filter",
"array",
"is",
"in",
"the",
"right",
"format",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Controller/ContactClientDetailsTrait.php#L36-L55 |
TheDMSGroup/mautic-contact-client | Controller/ContactClientDetailsTrait.php | ContactClientDetailsTrait.getEngagements | public function getEngagements(
ContactClient $contactClient,
array $filters = null,
array $orderBy = null,
$page = 1,
$limit = 25,
$forTimeline = true
) {
$session = $this->get('session');
$chartFilters = $session->get('mautic.contactclient.'.$contac... | php | public function getEngagements(
ContactClient $contactClient,
array $filters = null,
array $orderBy = null,
$page = 1,
$limit = 25,
$forTimeline = true
) {
$session = $this->get('session');
$chartFilters = $session->get('mautic.contactclient.'.$contac... | [
"public",
"function",
"getEngagements",
"(",
"ContactClient",
"$",
"contactClient",
",",
"array",
"$",
"filters",
"=",
"null",
",",
"array",
"$",
"orderBy",
"=",
"null",
",",
"$",
"page",
"=",
"1",
",",
"$",
"limit",
"=",
"25",
",",
"$",
"forTimeline",
... | @param ContactClient $contactClient
@param array|null $filters
@param array|null $orderBy
@param int $page
@param int $limit
@param bool $forTimeline
@return array | [
"@param",
"ContactClient",
"$contactClient",
"@param",
"array|null",
"$filters",
"@param",
"array|null",
"$orderBy",
"@param",
"int",
"$page",
"@param",
"int",
"$limit",
"@param",
"bool",
"$forTimeline"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Controller/ContactClientDetailsTrait.php#L67-L133 |
TheDMSGroup/mautic-contact-client | Controller/ContactClientDetailsTrait.php | ContactClientDetailsTrait.getAllEngagements | protected function getAllEngagements(
array $contactClients,
array $filters = null,
array $orderBy = null,
$page = 1,
$limit = 25
) {
$session = $this->get('session');
if (null === $filters) {
$chartfilters = $session->get(
'mautic... | php | protected function getAllEngagements(
array $contactClients,
array $filters = null,
array $orderBy = null,
$page = 1,
$limit = 25
) {
$session = $this->get('session');
if (null === $filters) {
$chartfilters = $session->get(
'mautic... | [
"protected",
"function",
"getAllEngagements",
"(",
"array",
"$",
"contactClients",
",",
"array",
"$",
"filters",
"=",
"null",
",",
"array",
"$",
"orderBy",
"=",
"null",
",",
"$",
"page",
"=",
"1",
",",
"$",
"limit",
"=",
"25",
")",
"{",
"$",
"session",... | @param array $contactClients
@param array|null $filters
@param array|null $orderBy
@param int $page
@param int $limit
@return array
@throws InvalidArgumentException | [
"@param",
"array",
"$contactClients",
"@param",
"array|null",
"$filters",
"@param",
"array|null",
"$orderBy",
"@param",
"int",
"$page",
"@param",
"int",
"$limit"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Controller/ContactClientDetailsTrait.php#L146-L231 |
TheDMSGroup/mautic-contact-client | Controller/ContactClientDetailsTrait.php | ContactClientDetailsTrait.getPlaces | protected function getPlaces(ContactClient $contactClient)
{
// Get Places from IP addresses
$places = [];
if ($contactClient->getIpAddresses()) {
foreach ($contactClient->getIpAddresses() as $ip) {
if ($details = $ip->getIpDetails()) {
if (!em... | php | protected function getPlaces(ContactClient $contactClient)
{
// Get Places from IP addresses
$places = [];
if ($contactClient->getIpAddresses()) {
foreach ($contactClient->getIpAddresses() as $ip) {
if ($details = $ip->getIpDetails()) {
if (!em... | [
"protected",
"function",
"getPlaces",
"(",
"ContactClient",
"$",
"contactClient",
")",
"{",
"// Get Places from IP addresses",
"$",
"places",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"contactClient",
"->",
"getIpAddresses",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
... | Get a list of places for the contactClient based on IP location.
@param ContactClient $contactClient
@return array | [
"Get",
"a",
"list",
"of",
"places",
"for",
"the",
"contactClient",
"based",
"on",
"IP",
"location",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Controller/ContactClientDetailsTrait.php#L240-L265 |
TheDMSGroup/mautic-contact-client | Controller/ContactClientDetailsTrait.php | ContactClientDetailsTrait.getAuditlogs | protected function getAuditlogs(
ContactClient $contactClient,
array $filters = null,
array $orderBy = null,
$page = 1,
$limit = 25
) {
$session = $this->get('session');
if (null == $filters) {
$filters = $session->get(
'mautic.con... | php | protected function getAuditlogs(
ContactClient $contactClient,
array $filters = null,
array $orderBy = null,
$page = 1,
$limit = 25
) {
$session = $this->get('session');
if (null == $filters) {
$filters = $session->get(
'mautic.con... | [
"protected",
"function",
"getAuditlogs",
"(",
"ContactClient",
"$",
"contactClient",
",",
"array",
"$",
"filters",
"=",
"null",
",",
"array",
"$",
"orderBy",
"=",
"null",
",",
"$",
"page",
"=",
"1",
",",
"$",
"limit",
"=",
"25",
")",
"{",
"$",
"session... | @param ContactClient $contactClient
@param array|null $filters
@param array|null $orderBy
@param int $page
@param int $limit
@return array | [
"@param",
"ContactClient",
"$contactClient",
"@param",
"array|null",
"$filters",
"@param",
"array|null",
"$orderBy",
"@param",
"int",
"$page",
"@param",
"int",
"$limit"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Controller/ContactClientDetailsTrait.php#L319-L381 |
TheDMSGroup/mautic-contact-client | Controller/ContactClientDetailsTrait.php | ContactClientDetailsTrait.getFiles | protected function getFiles(
ContactClient $contactClient,
array $filters = null,
array $orderBy = null,
$page = 1,
$limit = 25
) {
$session = $this->get('session');
$criteria = [];
if (null === $filters) {
$storedFilters = $session->get(
... | php | protected function getFiles(
ContactClient $contactClient,
array $filters = null,
array $orderBy = null,
$page = 1,
$limit = 25
) {
$session = $this->get('session');
$criteria = [];
if (null === $filters) {
$storedFilters = $session->get(
... | [
"protected",
"function",
"getFiles",
"(",
"ContactClient",
"$",
"contactClient",
",",
"array",
"$",
"filters",
"=",
"null",
",",
"array",
"$",
"orderBy",
"=",
"null",
",",
"$",
"page",
"=",
"1",
",",
"$",
"limit",
"=",
"25",
")",
"{",
"$",
"session",
... | @param ContactClient $contactClient
@param array|null $filters
@param array|null $orderBy
@param int $page
@param int $limit
@return array | [
"@param",
"ContactClient",
"$contactClient",
"@param",
"array|null",
"$filters",
"@param",
"array|null",
"$orderBy",
"@param",
"int",
"$page",
"@param",
"int",
"$limit"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Controller/ContactClientDetailsTrait.php#L392-L473 |
TheDMSGroup/mautic-contact-client | Controller/ContactClientDetailsTrait.php | ContactClientDetailsTrait.getScheduledCampaignEvents | protected function getScheduledCampaignEvents(ContactClient $contactClient)
{
// Upcoming events from Campaign Bundle
/** @var \Mautic\CampaignBundle\Entity\ContactClientEventLogRepository $contactClientEventLogRepository */
$contactClientEventLogRepository = $this->getDoctrine()->getManager... | php | protected function getScheduledCampaignEvents(ContactClient $contactClient)
{
// Upcoming events from Campaign Bundle
/** @var \Mautic\CampaignBundle\Entity\ContactClientEventLogRepository $contactClientEventLogRepository */
$contactClientEventLogRepository = $this->getDoctrine()->getManager... | [
"protected",
"function",
"getScheduledCampaignEvents",
"(",
"ContactClient",
"$",
"contactClient",
")",
"{",
"// Upcoming events from Campaign Bundle",
"/** @var \\Mautic\\CampaignBundle\\Entity\\ContactClientEventLogRepository $contactClientEventLogRepository */",
"$",
"contactClientEventLo... | @param ContactClient $contactClient
@return array | [
"@param",
"ContactClient",
"$contactClient"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Controller/ContactClientDetailsTrait.php#L480-L494 |
TheDMSGroup/mautic-contact-client | Helper/UtmSourceHelper.php | UtmSourceHelper.getFirstUtmSource | public function getFirstUtmSource(Contact $contact)
{
$source = '';
if (!empty($tags = $this->getSortedUtmTags($contact))) {
$tag = reset($tags);
$source = trim($tag->getUtmSource());
}
return $source;
} | php | public function getFirstUtmSource(Contact $contact)
{
$source = '';
if (!empty($tags = $this->getSortedUtmTags($contact))) {
$tag = reset($tags);
$source = trim($tag->getUtmSource());
}
return $source;
} | [
"public",
"function",
"getFirstUtmSource",
"(",
"Contact",
"$",
"contact",
")",
"{",
"$",
"source",
"=",
"''",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"tags",
"=",
"$",
"this",
"->",
"getSortedUtmTags",
"(",
"$",
"contact",
")",
")",
")",
"{",
"$",
... | @param Contact $contact
@return null|string | [
"@param",
"Contact",
"$contact"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Helper/UtmSourceHelper.php#L27-L36 |
TheDMSGroup/mautic-contact-client | Helper/UtmSourceHelper.php | UtmSourceHelper.getSortedUtmTags | public function getSortedUtmTags(Contact $contact)
{
$tags = [];
if ($contact instanceof Contact) {
$utmTags = $contact->getUtmTags();
if ($utmTags) {
$utmTags = $utmTags instanceof ArrayCollection ? $utmTags->toArray() : $utmTags;
/** @var \Ma... | php | public function getSortedUtmTags(Contact $contact)
{
$tags = [];
if ($contact instanceof Contact) {
$utmTags = $contact->getUtmTags();
if ($utmTags) {
$utmTags = $utmTags instanceof ArrayCollection ? $utmTags->toArray() : $utmTags;
/** @var \Ma... | [
"public",
"function",
"getSortedUtmTags",
"(",
"Contact",
"$",
"contact",
")",
"{",
"$",
"tags",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"contact",
"instanceof",
"Contact",
")",
"{",
"$",
"utmTags",
"=",
"$",
"contact",
"->",
"getUtmTags",
"(",
")",
";",
... | @param Contact $contact
@return array | [
"@param",
"Contact",
"$contact"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Helper/UtmSourceHelper.php#L43-L59 |
TheDMSGroup/mautic-contact-client | Helper/UtmSourceHelper.php | UtmSourceHelper.getLastUtmSource | public function getLastUtmSource(Contact $contact)
{
$source = '';
if (!empty($tags = $this->getSortedUtmTags($contact))) {
$tag = end($tags);
$source = trim($tag->getUtmSource());
}
return $source;
} | php | public function getLastUtmSource(Contact $contact)
{
$source = '';
if (!empty($tags = $this->getSortedUtmTags($contact))) {
$tag = end($tags);
$source = trim($tag->getUtmSource());
}
return $source;
} | [
"public",
"function",
"getLastUtmSource",
"(",
"Contact",
"$",
"contact",
")",
"{",
"$",
"source",
"=",
"''",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"tags",
"=",
"$",
"this",
"->",
"getSortedUtmTags",
"(",
"$",
"contact",
")",
")",
")",
"{",
"$",
... | @param Contact $contact
@return string | [
"@param",
"Contact",
"$contact"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Helper/UtmSourceHelper.php#L66-L75 |
TheDMSGroup/mautic-contact-client | EventListener/ContactClientSubscriber.php | ContactClientSubscriber.onContactClientPostSave | public function onContactClientPostSave(ContactClientEvent $event)
{
$entity = $event->getContactClient();
if ($details = $event->getChanges()) {
$log = [
'bundle' => 'contactclient',
'object' => 'contactclient',
'objectId' => $entit... | php | public function onContactClientPostSave(ContactClientEvent $event)
{
$entity = $event->getContactClient();
if ($details = $event->getChanges()) {
$log = [
'bundle' => 'contactclient',
'object' => 'contactclient',
'objectId' => $entit... | [
"public",
"function",
"onContactClientPostSave",
"(",
"ContactClientEvent",
"$",
"event",
")",
"{",
"$",
"entity",
"=",
"$",
"event",
"->",
"getContactClient",
"(",
")",
";",
"if",
"(",
"$",
"details",
"=",
"$",
"event",
"->",
"getChanges",
"(",
")",
")",
... | Add an entry to the audit log.
@param ContactClientEvent $event | [
"Add",
"an",
"entry",
"to",
"the",
"audit",
"log",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/EventListener/ContactClientSubscriber.php#L141-L155 |
TheDMSGroup/mautic-contact-client | EventListener/ContactClientSubscriber.php | ContactClientSubscriber.onContactClientDelete | public function onContactClientDelete(ContactClientEvent $event)
{
$entity = $event->getContactClient();
$log = [
'bundle' => 'contactclient',
'object' => 'contactclient',
'objectId' => $entity->deletedId,
'action' => 'delete',
... | php | public function onContactClientDelete(ContactClientEvent $event)
{
$entity = $event->getContactClient();
$log = [
'bundle' => 'contactclient',
'object' => 'contactclient',
'objectId' => $entity->deletedId,
'action' => 'delete',
... | [
"public",
"function",
"onContactClientDelete",
"(",
"ContactClientEvent",
"$",
"event",
")",
"{",
"$",
"entity",
"=",
"$",
"event",
"->",
"getContactClient",
"(",
")",
";",
"$",
"log",
"=",
"[",
"'bundle'",
"=>",
"'contactclient'",
",",
"'object'",
"=>",
"'c... | Add a delete entry to the audit log.
@param ContactClientEvent $event | [
"Add",
"a",
"delete",
"entry",
"to",
"the",
"audit",
"log",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/EventListener/ContactClientSubscriber.php#L162-L174 |
TheDMSGroup/mautic-contact-client | EventListener/ContactClientSubscriber.php | ContactClientSubscriber.onTimelineGenerate | public function onTimelineGenerate(ContactClientTimelineEvent $event)
{
/** @var EventRepository $eventRepository */
$eventRepository = $this->em->getRepository('MauticContactClientBundle:Event');
// Set available event types
// $event->addSerializerGroup(['formList', 'submissionEve... | php | public function onTimelineGenerate(ContactClientTimelineEvent $event)
{
/** @var EventRepository $eventRepository */
$eventRepository = $this->em->getRepository('MauticContactClientBundle:Event');
// Set available event types
// $event->addSerializerGroup(['formList', 'submissionEve... | [
"public",
"function",
"onTimelineGenerate",
"(",
"ContactClientTimelineEvent",
"$",
"event",
")",
"{",
"/** @var EventRepository $eventRepository */",
"$",
"eventRepository",
"=",
"$",
"this",
"->",
"em",
"->",
"getRepository",
"(",
"'MauticContactClientBundle:Event'",
")",... | Compile events for the lead timeline.
@param ContactClientTransactionsEvent $event | [
"Compile",
"events",
"for",
"the",
"lead",
"timeline",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/EventListener/ContactClientSubscriber.php#L181-L237 |
TheDMSGroup/mautic-contact-client | Entity/EventRepository.php | EventRepository.getEvents | public function getEvents($contactClientId, $eventType = null, $dateRange = [])
{
$q = $this->getEntityManager()->getConnection()->createQueryBuilder()
->from(MAUTIC_TABLE_PREFIX.'contactclient_events', 'c')
->select('c.*');
$expr = $q->expr()->eq('c.contactclient_id', ':con... | php | public function getEvents($contactClientId, $eventType = null, $dateRange = [])
{
$q = $this->getEntityManager()->getConnection()->createQueryBuilder()
->from(MAUTIC_TABLE_PREFIX.'contactclient_events', 'c')
->select('c.*');
$expr = $q->expr()->eq('c.contactclient_id', ':con... | [
"public",
"function",
"getEvents",
"(",
"$",
"contactClientId",
",",
"$",
"eventType",
"=",
"null",
",",
"$",
"dateRange",
"=",
"[",
"]",
")",
"{",
"$",
"q",
"=",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
"->",
"getConnection",
"(",
")",
"->",
... | Fetch the base event data from the database.
@param $contactClientId
@param $eventType
@param array|null $dateRange
@return array | [
"Fetch",
"the",
"base",
"event",
"data",
"from",
"the",
"database",
"."
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Entity/EventRepository.php#L31-L79 |
TheDMSGroup/mautic-contact-client | Entity/EventRepository.php | EventRepository.getEventsForTimeline | public function getEventsForTimeline($contactClientId, array $options = [])
{
$query = $this->getEntityManager()->getConnection()->createQueryBuilder()
->from(MAUTIC_TABLE_PREFIX.'contactclient_events', 'c');
$query->select('c.*, s.utm_source');
$query->leftJoin(
'c... | php | public function getEventsForTimeline($contactClientId, array $options = [])
{
$query = $this->getEntityManager()->getConnection()->createQueryBuilder()
->from(MAUTIC_TABLE_PREFIX.'contactclient_events', 'c');
$query->select('c.*, s.utm_source');
$query->leftJoin(
'c... | [
"public",
"function",
"getEventsForTimeline",
"(",
"$",
"contactClientId",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
"->",
"getConnection",
"(",
")",
"->",
"createQueryBuilder",... | @param $contactClientId
@param array $options
@param bool $countOnly
@return array | [
"@param",
"$contactClientId",
"@param",
"array",
"$options",
"@param",
"bool",
"$countOnly"
] | train | https://github.com/TheDMSGroup/mautic-contact-client/blob/5874413494d1c73bc18749c0e75c87e7ccc6d65a/Entity/EventRepository.php#L88-L196 |
funkjedi/composer-include-files | src/Composer/AutoloadGenerator.php | AutoloadGenerator.dumpFiles | public function dumpFiles(Composer $composer, $paths, $targetDir = 'composer', $suffix = '', $staticPhpVersion = 70000)
{
$installationManager = $composer->getInstallationManager();
$localRepo = $composer->getRepositoryManager()->getLocalRepository();
$mainPackage = $composer->getPackage();
$config = $composer... | php | public function dumpFiles(Composer $composer, $paths, $targetDir = 'composer', $suffix = '', $staticPhpVersion = 70000)
{
$installationManager = $composer->getInstallationManager();
$localRepo = $composer->getRepositoryManager()->getLocalRepository();
$mainPackage = $composer->getPackage();
$config = $composer... | [
"public",
"function",
"dumpFiles",
"(",
"Composer",
"$",
"composer",
",",
"$",
"paths",
",",
"$",
"targetDir",
"=",
"'composer'",
",",
"$",
"suffix",
"=",
"''",
",",
"$",
"staticPhpVersion",
"=",
"70000",
")",
"{",
"$",
"installationManager",
"=",
"$",
"... | @param \Composer\Composer
@param string
@param string
@see https://github.com/composer/composer/blob/master/src/Composer/Autoload/AutoloadGenerator.php#L115 | [
"@param",
"\\",
"Composer",
"\\",
"Composer",
"@param",
"string",
"@param",
"string"
] | train | https://github.com/funkjedi/composer-include-files/blob/17d155db42578496559769bfa1c05ed790b8e34c/src/Composer/AutoloadGenerator.php#L45-L96 |
funkjedi/composer-include-files | src/Plugin.php | Plugin.activate | public function activate(Composer $composer, IOInterface $io)
{
$this->composer = $composer;
$this->generator = new AutoloadGenerator($composer->getEventDispatcher(), $io);
} | php | public function activate(Composer $composer, IOInterface $io)
{
$this->composer = $composer;
$this->generator = new AutoloadGenerator($composer->getEventDispatcher(), $io);
} | [
"public",
"function",
"activate",
"(",
"Composer",
"$",
"composer",
",",
"IOInterface",
"$",
"io",
")",
"{",
"$",
"this",
"->",
"composer",
"=",
"$",
"composer",
";",
"$",
"this",
"->",
"generator",
"=",
"new",
"AutoloadGenerator",
"(",
"$",
"composer",
... | Apply plugin modifications to Composer
@param Composer $composer
@param IOInterface $io | [
"Apply",
"plugin",
"modifications",
"to",
"Composer"
] | train | https://github.com/funkjedi/composer-include-files/blob/17d155db42578496559769bfa1c05ed790b8e34c/src/Plugin.php#L30-L34 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.