repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
partition
stringclasses
1 value
nixsolutions/yandex-php-library
src/Yandex/Metrica/MetricaClient.php
MetricaClient.sendDeleteRequest
protected function sendDeleteRequest($resource) { $response = $this->sendRequest( 'DELETE', $this->getServiceUrl($resource), [ 'headers' => [ 'Accept' => 'application/x-yametrika+json', 'Content-Type' => 'application/x-yametrika+json', 'Authorization' => 'OAuth ' . $this->getAccessToken(), ] ] ); return $this->getDecodedBody($response->getBody()); }
php
protected function sendDeleteRequest($resource) { $response = $this->sendRequest( 'DELETE', $this->getServiceUrl($resource), [ 'headers' => [ 'Accept' => 'application/x-yametrika+json', 'Content-Type' => 'application/x-yametrika+json', 'Authorization' => 'OAuth ' . $this->getAccessToken(), ] ] ); return $this->getDecodedBody($response->getBody()); }
[ "protected", "function", "sendDeleteRequest", "(", "$", "resource", ")", "{", "$", "response", "=", "$", "this", "->", "sendRequest", "(", "'DELETE'", ",", "$", "this", "->", "getServiceUrl", "(", "$", "resource", ")", ",", "[", "'headers'", "=>", "[", "...
Send DELETE request to API resource @param string $resource @return array
[ "Send", "DELETE", "request", "to", "API", "resource" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Metrica/MetricaClient.php#L255-L270
train
nixsolutions/yandex-php-library
src/Yandex/Metrica/Management/GoalsClient.php
GoalsClient.getGoals
public function getGoals($counterId) { $resource = 'counter/' . $counterId . '/goals'; $response = $this->sendGetRequest($resource); $goalResponse = new Models\GetGoalsResponse($response); return $goalResponse->getGoals(); }
php
public function getGoals($counterId) { $resource = 'counter/' . $counterId . '/goals'; $response = $this->sendGetRequest($resource); $goalResponse = new Models\GetGoalsResponse($response); return $goalResponse->getGoals(); }
[ "public", "function", "getGoals", "(", "$", "counterId", ")", "{", "$", "resource", "=", "'counter/'", ".", "$", "counterId", ".", "'/goals'", ";", "$", "response", "=", "$", "this", "->", "sendGetRequest", "(", "$", "resource", ")", ";", "$", "goalRespo...
Get counter goals @see http://api.yandex.ru/metrika/doc/beta/management/goals/goals.xml @param int $counterId @return Models\Goals
[ "Get", "counter", "goals" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Metrica/Management/GoalsClient.php#L24-L30
train
nixsolutions/yandex-php-library
src/Yandex/Metrica/Management/GoalsClient.php
GoalsClient.addGoal
public function addGoal($counterId, Models\Goal $goal) { $resource = 'counter/' . $counterId . '/goals'; $response = $this->sendPostRequest($resource, ["goal" => $goal->toArray()]); $goalResponse = new Models\AddGoalResponse($response); return $goalResponse->getGoal(); }
php
public function addGoal($counterId, Models\Goal $goal) { $resource = 'counter/' . $counterId . '/goals'; $response = $this->sendPostRequest($resource, ["goal" => $goal->toArray()]); $goalResponse = new Models\AddGoalResponse($response); return $goalResponse->getGoal(); }
[ "public", "function", "addGoal", "(", "$", "counterId", ",", "Models", "\\", "Goal", "$", "goal", ")", "{", "$", "resource", "=", "'counter/'", ".", "$", "counterId", ".", "'/goals'", ";", "$", "response", "=", "$", "this", "->", "sendPostRequest", "(", ...
Add goal to counter @see http://api.yandex.ru/metrika/doc/beta/management/goals/addgoal.xml @param int $counterId @param Models\Goal $goal @return Models\Goal
[ "Add", "goal", "to", "counter" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Metrica/Management/GoalsClient.php#L42-L48
train
nixsolutions/yandex-php-library
src/Yandex/Metrica/Management/GoalsClient.php
GoalsClient.getGoal
public function getGoal($id, $counterId) { $resource = 'counter/' . $counterId . '/goal/' . $id; $response = $this->sendGetRequest($resource); $goalResponse = new Models\GetGoalResponse($response); return $goalResponse->getGoal(); }
php
public function getGoal($id, $counterId) { $resource = 'counter/' . $counterId . '/goal/' . $id; $response = $this->sendGetRequest($resource); $goalResponse = new Models\GetGoalResponse($response); return $goalResponse->getGoal(); }
[ "public", "function", "getGoal", "(", "$", "id", ",", "$", "counterId", ")", "{", "$", "resource", "=", "'counter/'", ".", "$", "counterId", ".", "'/goal/'", ".", "$", "id", ";", "$", "response", "=", "$", "this", "->", "sendGetRequest", "(", "$", "r...
Get counter goal @see http://api.yandex.ru/metrika/doc/beta/management/goals/goal.xml @param int $id @param int $counterId @return Models\Goal
[ "Get", "counter", "goal" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Metrica/Management/GoalsClient.php#L60-L66
train
nixsolutions/yandex-php-library
src/Yandex/Metrica/Management/GoalsClient.php
GoalsClient.updateGoal
public function updateGoal($id, $counterId, Models\Goal $goal) { $resource = 'counter/' . $counterId . '/goal/' . $id; $response = $this->sendPutRequest($resource, ["goal" => $goal->toArray()]); $goalResponse = new Models\UpdateGoalResponse($response); return $goalResponse->getGoal(); }
php
public function updateGoal($id, $counterId, Models\Goal $goal) { $resource = 'counter/' . $counterId . '/goal/' . $id; $response = $this->sendPutRequest($resource, ["goal" => $goal->toArray()]); $goalResponse = new Models\UpdateGoalResponse($response); return $goalResponse->getGoal(); }
[ "public", "function", "updateGoal", "(", "$", "id", ",", "$", "counterId", ",", "Models", "\\", "Goal", "$", "goal", ")", "{", "$", "resource", "=", "'counter/'", ".", "$", "counterId", ".", "'/goal/'", ".", "$", "id", ";", "$", "response", "=", "$",...
Update counter goal @see http://api.yandex.ru/metrika/doc/beta/management/goals/editgoal.xml @param int $id @param int $counterId @param Models\Goal $goal @return Models\Goal
[ "Update", "counter", "goal" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Metrica/Management/GoalsClient.php#L79-L85
train
nixsolutions/yandex-php-library
src/Yandex/Metrica/Management/GoalsClient.php
GoalsClient.deleteGoal
public function deleteGoal($id, $counterId) { $resource = 'counter/' . $counterId . '/goal/' . $id; $response = $this->sendDeleteRequest($resource); return $response; }
php
public function deleteGoal($id, $counterId) { $resource = 'counter/' . $counterId . '/goal/' . $id; $response = $this->sendDeleteRequest($resource); return $response; }
[ "public", "function", "deleteGoal", "(", "$", "id", ",", "$", "counterId", ")", "{", "$", "resource", "=", "'counter/'", ".", "$", "counterId", ".", "'/goal/'", ".", "$", "id", ";", "$", "response", "=", "$", "this", "->", "sendDeleteRequest", "(", "$"...
Delete counter goal @see http://api.yandex.ru/metrika/doc/ref/reference/del-counter-goal.xml @param int $id @param int $counterId @return array
[ "Delete", "counter", "goal" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Metrica/Management/GoalsClient.php#L97-L102
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/Models/Vendors.php
Vendors.add
public function add($vendor) { if (is_array($vendor)) { $this->collection[] = new Vendor($vendor); } elseif (is_object($vendor) && $vendor instanceof Vendor) { $this->collection[] = $vendor; } return $this; }
php
public function add($vendor) { if (is_array($vendor)) { $this->collection[] = new Vendor($vendor); } elseif (is_object($vendor) && $vendor instanceof Vendor) { $this->collection[] = $vendor; } return $this; }
[ "public", "function", "add", "(", "$", "vendor", ")", "{", "if", "(", "is_array", "(", "$", "vendor", ")", ")", "{", "$", "this", "->", "collection", "[", "]", "=", "new", "Vendor", "(", "$", "vendor", ")", ";", "}", "elseif", "(", "is_object", "...
Add vendor to collection @param Vendor|array $vendor @return Vendors
[ "Add", "vendor", "to", "collection" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/Models/Vendors.php#L16-L25
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/ContentClient.php
ContentClient.getLimit
public function getLimit($name) { if (isset($this->limits[$name])) { return $this->limits[$name]; } return false; }
php
public function getLimit($name) { if (isset($this->limits[$name])) { return $this->limits[$name]; } return false; }
[ "public", "function", "getLimit", "(", "$", "name", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "limits", "[", "$", "name", "]", ")", ")", "{", "return", "$", "this", "->", "limits", "[", "$", "name", "]", ";", "}", "return", "false", ...
Get information about specified API limit @return array|false
[ "Get", "information", "about", "specified", "API", "limit" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/ContentClient.php#L188-L195
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/ContentClient.php
ContentClient.getServiceResponse
protected function getServiceResponse($resource) { $response = $this->sendRequest('GET', $this->getServiceUrl($resource)); $decodedResponseBody = $this->getDecodedBody($response->getBody()); return $decodedResponseBody; }
php
protected function getServiceResponse($resource) { $response = $this->sendRequest('GET', $this->getServiceUrl($resource)); $decodedResponseBody = $this->getDecodedBody($response->getBody()); return $decodedResponseBody; }
[ "protected", "function", "getServiceResponse", "(", "$", "resource", ")", "{", "$", "response", "=", "$", "this", "->", "sendRequest", "(", "'GET'", ",", "$", "this", "->", "getServiceUrl", "(", "$", "resource", ")", ")", ";", "$", "decodedResponseBody", "...
Returns API service response. @param string $resource @return array @throws ContentRequestException @throws ForbiddenException @throws UnauthorizedException
[ "Returns", "API", "service", "response", "." ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/ContentClient.php#L206-L212
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/ContentClient.php
ContentClient.buildQueryString
protected function buildQueryString($queryData, $prefix = '', $argSeparator = '&', $encType = PHP_QUERY_RFC3986) { foreach ($queryData as $k => &$v) { if (!is_scalar($v)) { $v = implode(',', $v); } } $queryString = http_build_query($queryData, $prefix, $argSeparator, $encType); foreach ($queryData as $k => $v) { if ($k==$v) { $queryString = str_replace("$k=$v", $v, $queryString); } } return $queryString; }
php
protected function buildQueryString($queryData, $prefix = '', $argSeparator = '&', $encType = PHP_QUERY_RFC3986) { foreach ($queryData as $k => &$v) { if (!is_scalar($v)) { $v = implode(',', $v); } } $queryString = http_build_query($queryData, $prefix, $argSeparator, $encType); foreach ($queryData as $k => $v) { if ($k==$v) { $queryString = str_replace("$k=$v", $v, $queryString); } } return $queryString; }
[ "protected", "function", "buildQueryString", "(", "$", "queryData", ",", "$", "prefix", "=", "''", ",", "$", "argSeparator", "=", "'&'", ",", "$", "encType", "=", "PHP_QUERY_RFC3986", ")", "{", "foreach", "(", "$", "queryData", "as", "$", "k", "=>", "&",...
Returns URL-encoded query string @note: similar to http_build_query(), but transform key=>value where key == value to "?key" param. @param array|object $queryData @param string $prefix @param string $argSeparator @param int $encType @return string $queryString
[ "Returns", "URL", "-", "encoded", "query", "string" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/ContentClient.php#L227-L244
train
nixsolutions/yandex-php-library
src/Yandex/Metrica/Management/OperationsClient.php
OperationsClient.getOperations
public function getOperations($counterId, $params = []) { $resource = 'counter/' . $counterId . '/operations'; $response = $this->sendGetRequest($resource, $params); $operationResponse = new Models\GetOperationsResponse($response); return $operationResponse->getOperations(); }
php
public function getOperations($counterId, $params = []) { $resource = 'counter/' . $counterId . '/operations'; $response = $this->sendGetRequest($resource, $params); $operationResponse = new Models\GetOperationsResponse($response); return $operationResponse->getOperations(); }
[ "public", "function", "getOperations", "(", "$", "counterId", ",", "$", "params", "=", "[", "]", ")", "{", "$", "resource", "=", "'counter/'", ".", "$", "counterId", ".", "'/operations'", ";", "$", "response", "=", "$", "this", "->", "sendGetRequest", "(...
Get counter operations @see http://api.yandex.ru/metrika/doc/beta/management/operations/operations.xml @param int $counterId @param array $params @return array
[ "Get", "counter", "operations" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Metrica/Management/OperationsClient.php#L25-L31
train
nixsolutions/yandex-php-library
src/Yandex/Metrica/Management/OperationsClient.php
OperationsClient.addOperation
public function addOperation($counterId, Models\Operation $operation) { $resource = 'counter/' . $counterId . '/operations'; $response = $this->sendPostRequest($resource, ["operation" => $operation->toArray()]); $operationResponse = new Models\AddOperationResponse($response); return $operationResponse->getOperation(); }
php
public function addOperation($counterId, Models\Operation $operation) { $resource = 'counter/' . $counterId . '/operations'; $response = $this->sendPostRequest($resource, ["operation" => $operation->toArray()]); $operationResponse = new Models\AddOperationResponse($response); return $operationResponse->getOperation(); }
[ "public", "function", "addOperation", "(", "$", "counterId", ",", "Models", "\\", "Operation", "$", "operation", ")", "{", "$", "resource", "=", "'counter/'", ".", "$", "counterId", ".", "'/operations'", ";", "$", "response", "=", "$", "this", "->", "sendP...
Add operation to counter @see http://api.yandex.ru/metrika/doc/beta/management/operations/addoperation.xml @param int $counterId @param Models\Operation $operation @return Models\Operation
[ "Add", "operation", "to", "counter" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Metrica/Management/OperationsClient.php#L43-L49
train
nixsolutions/yandex-php-library
src/Yandex/Metrica/Management/OperationsClient.php
OperationsClient.getOperation
public function getOperation($id, $counterId, $params = []) { $resource = 'counter/' . $counterId . '/operation/' . $id; $response = $this->sendGetRequest($resource, $params); $operationResponse = new Models\GetOperationResponse($response); return $operationResponse->getOperation(); }
php
public function getOperation($id, $counterId, $params = []) { $resource = 'counter/' . $counterId . '/operation/' . $id; $response = $this->sendGetRequest($resource, $params); $operationResponse = new Models\GetOperationResponse($response); return $operationResponse->getOperation(); }
[ "public", "function", "getOperation", "(", "$", "id", ",", "$", "counterId", ",", "$", "params", "=", "[", "]", ")", "{", "$", "resource", "=", "'counter/'", ".", "$", "counterId", ".", "'/operation/'", ".", "$", "id", ";", "$", "response", "=", "$",...
Get counter operation @see http://api.yandex.ru/metrika/doc/beta/management/operations/operation.xml @param int $id @param int $counterId @param array $params @return Models\Operation
[ "Get", "counter", "operation" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Metrica/Management/OperationsClient.php#L62-L68
train
nixsolutions/yandex-php-library
src/Yandex/Metrica/Management/OperationsClient.php
OperationsClient.updateOperation
public function updateOperation($id, $counterId, Models\Operation $operation) { $resource = 'counter/' . $counterId . '/operation/' . $id; $response = $this->sendPutRequest($resource, ["operation" => $operation->toArray()]); $operationsResponse = new Models\UpdateOperationResponse($response); return $operationsResponse->getOperation(); }
php
public function updateOperation($id, $counterId, Models\Operation $operation) { $resource = 'counter/' . $counterId . '/operation/' . $id; $response = $this->sendPutRequest($resource, ["operation" => $operation->toArray()]); $operationsResponse = new Models\UpdateOperationResponse($response); return $operationsResponse->getOperation(); }
[ "public", "function", "updateOperation", "(", "$", "id", ",", "$", "counterId", ",", "Models", "\\", "Operation", "$", "operation", ")", "{", "$", "resource", "=", "'counter/'", ".", "$", "counterId", ".", "'/operation/'", ".", "$", "id", ";", "$", "resp...
Update counter operation @see http://api.yandex.ru/metrika/doc/beta/management/operations/editoperation.xml @param int $id @param int $counterId @param Models\Operation $operation @return Models\Operation
[ "Update", "counter", "operation" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Metrica/Management/OperationsClient.php#L81-L87
train
nixsolutions/yandex-php-library
src/Yandex/Metrica/Management/OperationsClient.php
OperationsClient.deleteCounterOperation
public function deleteCounterOperation($id, $counterId) { $resource = 'counter/' . $counterId . '/operation/' . $id; $response = $this->sendDeleteRequest($resource); return $response; }
php
public function deleteCounterOperation($id, $counterId) { $resource = 'counter/' . $counterId . '/operation/' . $id; $response = $this->sendDeleteRequest($resource); return $response; }
[ "public", "function", "deleteCounterOperation", "(", "$", "id", ",", "$", "counterId", ")", "{", "$", "resource", "=", "'counter/'", ".", "$", "counterId", ".", "'/operation/'", ".", "$", "id", ";", "$", "response", "=", "$", "this", "->", "sendDeleteReque...
Delete counter operation @see http://api.yandex.ru/metrika/doc/ref/reference/del-counter-operation.xml @param int $id @param int $counterId @return array
[ "Delete", "counter", "operation" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Metrica/Management/OperationsClient.php#L99-L104
train
nixsolutions/yandex-php-library
src/Yandex/Market/Partner/PartnerClient.php
PartnerClient.getCampaigns
public function getCampaigns() { $resource = 'campaigns.json'; $response = $this->sendRequest('GET', $this->getServiceUrl($resource)); $decodedResponseBody = $this->getDecodedBody($response->getBody()); $getCampaignsResponse = new GetCampaignsResponse($decodedResponseBody); return $getCampaignsResponse->getCampaigns(); }
php
public function getCampaigns() { $resource = 'campaigns.json'; $response = $this->sendRequest('GET', $this->getServiceUrl($resource)); $decodedResponseBody = $this->getDecodedBody($response->getBody()); $getCampaignsResponse = new GetCampaignsResponse($decodedResponseBody); return $getCampaignsResponse->getCampaigns(); }
[ "public", "function", "getCampaigns", "(", ")", "{", "$", "resource", "=", "'campaigns.json'", ";", "$", "response", "=", "$", "this", "->", "sendRequest", "(", "'GET'", ",", "$", "this", "->", "getServiceUrl", "(", "$", "resource", ")", ")", ";", "$", ...
Get User Campaigns Returns the user to the list of campaigns Yandex.market. The list coincides with the list of campaigns that are displayed in the partner interface Yandex.Market on page "My shops." @see http://api.yandex.ru/market/partner/doc/dg/reference/get-campaigns.xml @return Campaigns
[ "Get", "User", "Campaigns" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Partner/PartnerClient.php#L305-L315
train
nixsolutions/yandex-php-library
src/Yandex/Market/Partner/PartnerClient.php
PartnerClient.getCampaignsByLogin
public function getCampaignsByLogin($login) { $resource = 'campaigns/by_login/' . $login . '.json'; $response = $this->sendRequest('GET', $this->getServiceUrl($resource)); $decodedResponseBody = $this->getDecodedBody($response->getBody()); $getCampaignsResponse = new Models\GetCampaignsResponse($decodedResponseBody); return $getCampaignsResponse->getCampaigns(); }
php
public function getCampaignsByLogin($login) { $resource = 'campaigns/by_login/' . $login . '.json'; $response = $this->sendRequest('GET', $this->getServiceUrl($resource)); $decodedResponseBody = $this->getDecodedBody($response->getBody()); $getCampaignsResponse = new Models\GetCampaignsResponse($decodedResponseBody); return $getCampaignsResponse->getCampaigns(); }
[ "public", "function", "getCampaignsByLogin", "(", "$", "login", ")", "{", "$", "resource", "=", "'campaigns/by_login/'", ".", "$", "login", ".", "'.json'", ";", "$", "response", "=", "$", "this", "->", "sendRequest", "(", "'GET'", ",", "$", "this", "->", ...
Get User Campaigns by Login @link https://tech.yandex.ru/market/partner/doc/dg/reference/get-campaigns-by-login-docpage/ @return Models\Campaigns
[ "Get", "User", "Campaigns", "by", "Login" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Partner/PartnerClient.php#L324-L334
train
nixsolutions/yandex-php-library
src/Yandex/Market/Partner/PartnerClient.php
PartnerClient.getLoginsByCampaign
public function getLoginsByCampaign() { $resource = 'campaigns/' . $this->campaignId . '/logins.json'; $response = $this->sendRequest('GET', $this->getServiceUrl($resource)); $decodedResponseBody = $this->getDecodedBody($response->getBody()); return StringCollection::init($decodedResponseBody['logins']); }
php
public function getLoginsByCampaign() { $resource = 'campaigns/' . $this->campaignId . '/logins.json'; $response = $this->sendRequest('GET', $this->getServiceUrl($resource)); $decodedResponseBody = $this->getDecodedBody($response->getBody()); return StringCollection::init($decodedResponseBody['logins']); }
[ "public", "function", "getLoginsByCampaign", "(", ")", "{", "$", "resource", "=", "'campaigns/'", ".", "$", "this", "->", "campaignId", ".", "'/logins.json'", ";", "$", "response", "=", "$", "this", "->", "sendRequest", "(", "'GET'", ",", "$", "this", "->"...
Get logins by campaign id @link https://tech.yandex.ru/market/partner/doc/dg/reference/get-campaigns-id-logins-docpage/ @return StringCollection
[ "Get", "logins", "by", "campaign", "id" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Partner/PartnerClient.php#L343-L352
train
nixsolutions/yandex-php-library
src/Yandex/Market/Partner/PartnerClient.php
PartnerClient.getOutlet
public function getOutlet($outletId) { $resource = 'campaigns/' . $this->campaignId . '/outlets/' . $outletId . '.json'; $response = $this->sendRequest('GET', $this->getServiceUrl($resource)); $decodedResponseBody = $this->getDecodedBody($response->getBody()); $getOrderResponse = new Models\GetOutletResponse($decodedResponseBody); return $getOrderResponse->getOutlet(); }
php
public function getOutlet($outletId) { $resource = 'campaigns/' . $this->campaignId . '/outlets/' . $outletId . '.json'; $response = $this->sendRequest('GET', $this->getServiceUrl($resource)); $decodedResponseBody = $this->getDecodedBody($response->getBody()); $getOrderResponse = new Models\GetOutletResponse($decodedResponseBody); return $getOrderResponse->getOutlet(); }
[ "public", "function", "getOutlet", "(", "$", "outletId", ")", "{", "$", "resource", "=", "'campaigns/'", ".", "$", "this", "->", "campaignId", ".", "'/outlets/'", ".", "$", "outletId", ".", "'.json'", ";", "$", "response", "=", "$", "this", "->", "sendRe...
Get outlet info @param $outletId @link https://tech.yandex.ru/market/partner/doc/dg/reference/get-campaigns-id-outlets-id-docpage/ @return null|Models\Outlet
[ "Get", "outlet", "info" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Partner/PartnerClient.php#L394-L404
train
nixsolutions/yandex-php-library
src/Yandex/Market/Partner/PartnerClient.php
PartnerClient.getOrdersResponse
public function getOrdersResponse($params = []) { $resource = 'campaigns/' . $this->campaignId . '/orders.json'; $resource .= '?' . http_build_query($params); $response = $this->sendRequest('GET', $this->getServiceUrl($resource)); $decodedResponseBody = $this->getDecodedBody($response->getBody()); return new GetOrdersResponse($decodedResponseBody); }
php
public function getOrdersResponse($params = []) { $resource = 'campaigns/' . $this->campaignId . '/orders.json'; $resource .= '?' . http_build_query($params); $response = $this->sendRequest('GET', $this->getServiceUrl($resource)); $decodedResponseBody = $this->getDecodedBody($response->getBody()); return new GetOrdersResponse($decodedResponseBody); }
[ "public", "function", "getOrdersResponse", "(", "$", "params", "=", "[", "]", ")", "{", "$", "resource", "=", "'campaigns/'", ".", "$", "this", "->", "campaignId", ".", "'/orders.json'", ";", "$", "resource", ".=", "'?'", ".", "http_build_query", "(", "$",...
Get information about orders by campaign id @param array $params Returns information on the requested orders. Available filtering by date ordering and order status. The maximum range of dates in a single request for a resource - 30 days. @see http://api.yandex.ru/market/partner/doc/dg/reference/get-campaigns-id-orders.xml @return GetOrdersResponse
[ "Get", "information", "about", "orders", "by", "campaign", "id" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Partner/PartnerClient.php#L420-L430
train
nixsolutions/yandex-php-library
src/Yandex/Market/Partner/PartnerClient.php
PartnerClient.getOrder
public function getOrder($orderId) { $resource = 'campaigns/' . $this->campaignId . '/orders/' . $orderId . '.json'; $response = $this->sendRequest('GET', $this->getServiceUrl($resource)); $decodedResponseBody = $this->getDecodedBody($response->getBody()); $getOrderResponse = new GetOrderResponse($decodedResponseBody); return $getOrderResponse->getOrder(); }
php
public function getOrder($orderId) { $resource = 'campaigns/' . $this->campaignId . '/orders/' . $orderId . '.json'; $response = $this->sendRequest('GET', $this->getServiceUrl($resource)); $decodedResponseBody = $this->getDecodedBody($response->getBody()); $getOrderResponse = new GetOrderResponse($decodedResponseBody); return $getOrderResponse->getOrder(); }
[ "public", "function", "getOrder", "(", "$", "orderId", ")", "{", "$", "resource", "=", "'campaigns/'", ".", "$", "this", "->", "campaignId", ".", "'/orders/'", ".", "$", "orderId", ".", "'.json'", ";", "$", "response", "=", "$", "this", "->", "sendReques...
Get order info @param int $orderId @return Order @link http://api.yandex.ru/market/partner/doc/dg/reference/get-campaigns-id-orders-id.xml
[ "Get", "order", "info" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Partner/PartnerClient.php#L451-L461
train
nixsolutions/yandex-php-library
src/Yandex/Market/Partner/PartnerClient.php
PartnerClient.getSettings
public function getSettings() { $resource = 'campaigns/' . $this->campaignId . '/settings.json'; $response = $this->sendRequest('GET', $this->getServiceUrl($resource)); $decodedResponseBody = $this->getDecodedBody($response->getBody()); $getSettingsResponse = new Models\GetSettingsResponse($decodedResponseBody); return $getSettingsResponse->getSettings(); }
php
public function getSettings() { $resource = 'campaigns/' . $this->campaignId . '/settings.json'; $response = $this->sendRequest('GET', $this->getServiceUrl($resource)); $decodedResponseBody = $this->getDecodedBody($response->getBody()); $getSettingsResponse = new Models\GetSettingsResponse($decodedResponseBody); return $getSettingsResponse->getSettings(); }
[ "public", "function", "getSettings", "(", ")", "{", "$", "resource", "=", "'campaigns/'", ".", "$", "this", "->", "campaignId", ".", "'/settings.json'", ";", "$", "response", "=", "$", "this", "->", "sendRequest", "(", "'GET'", ",", "$", "this", "->", "g...
Get Campaign settings @retun Models\Settings @link https://tech.yandex.ru/market/partner/doc/dg/reference/get-campaigns-id-settings-docpage/
[ "Get", "Campaign", "settings" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Partner/PartnerClient.php#L488-L498
train
nixsolutions/yandex-php-library
src/Yandex/Market/Partner/PartnerClient.php
PartnerClient.setOrderStatus
public function setOrderStatus($orderId, $status, $subStatus = null) { $resource = 'campaigns/' . $this->campaignId . '/orders/' . $orderId . '/status.json'; $data = [ "order" => [ "status" => $status ] ]; if ($subStatus) { $data['order']['substatus'] = $subStatus; } $response = $this->sendRequest( 'PUT', $this->getServiceUrl($resource), [ 'json' => $data ] ); $decodedResponseBody = $this->getDecodedBody($response->getBody()); $updateOrderStatusResponse = new UpdateOrderStatusResponse($decodedResponseBody); return $updateOrderStatusResponse->getOrder(); }
php
public function setOrderStatus($orderId, $status, $subStatus = null) { $resource = 'campaigns/' . $this->campaignId . '/orders/' . $orderId . '/status.json'; $data = [ "order" => [ "status" => $status ] ]; if ($subStatus) { $data['order']['substatus'] = $subStatus; } $response = $this->sendRequest( 'PUT', $this->getServiceUrl($resource), [ 'json' => $data ] ); $decodedResponseBody = $this->getDecodedBody($response->getBody()); $updateOrderStatusResponse = new UpdateOrderStatusResponse($decodedResponseBody); return $updateOrderStatusResponse->getOrder(); }
[ "public", "function", "setOrderStatus", "(", "$", "orderId", ",", "$", "status", ",", "$", "subStatus", "=", "null", ")", "{", "$", "resource", "=", "'campaigns/'", ".", "$", "this", "->", "campaignId", ".", "'/orders/'", ".", "$", "orderId", ".", "'/sta...
Send changed status to Yandex.Market @param int $orderId @param string $status @param null|string $subStatus @return Order @link http://api.yandex.ru/market/partner/doc/dg/reference/put-campaigns-id-orders-id-status.xml
[ "Send", "changed", "status", "to", "Yandex", ".", "Market" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Partner/PartnerClient.php#L530-L555
train
nixsolutions/yandex-php-library
src/Yandex/Market/Partner/PartnerClient.php
PartnerClient.updateDelivery
public function updateDelivery($orderId, Delivery $delivery) { $resource = 'campaigns/' . $this->campaignId . '/orders/' . $orderId . '/delivery.json'; $response = $this->sendRequest( 'PUT', $this->getServiceUrl($resource), [ 'json' => [ 'delivery' => $delivery->toArray() ] ] ); $decodedResponseBody = $this->getDecodedBody($response->getBody()); $updateOrderDeliveryResponse = new UpdateOrderDeliveryResponse($decodedResponseBody); return $updateOrderDeliveryResponse->getOrder(); }
php
public function updateDelivery($orderId, Delivery $delivery) { $resource = 'campaigns/' . $this->campaignId . '/orders/' . $orderId . '/delivery.json'; $response = $this->sendRequest( 'PUT', $this->getServiceUrl($resource), [ 'json' => [ 'delivery' => $delivery->toArray() ] ] ); $decodedResponseBody = $this->getDecodedBody($response->getBody()); $updateOrderDeliveryResponse = new UpdateOrderDeliveryResponse($decodedResponseBody); return $updateOrderDeliveryResponse->getOrder(); }
[ "public", "function", "updateDelivery", "(", "$", "orderId", ",", "Delivery", "$", "delivery", ")", "{", "$", "resource", "=", "'campaigns/'", ".", "$", "this", "->", "campaignId", ".", "'/orders/'", ".", "$", "orderId", ".", "'/delivery.json'", ";", "$", ...
Update changed delivery parameters @param int $orderId @param Delivery $delivery @return Order Example: PUT /v2/campaigns/10003/order/12345/delivery.json HTTP/1.1 @link http://api.yandex.ru/market/partner/doc/dg/reference/put-campaigns-id-orders-id-delivery.xml
[ "Update", "changed", "delivery", "parameters" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Partner/PartnerClient.php#L570-L588
train
nixsolutions/yandex-php-library
src/Yandex/Market/Partner/PartnerClient.php
PartnerClient.findModels
public function findModels($searchQuery, $regionId, $page = null, $pageSize = null, $currency = null) { $resource = sprintf('models.%s', self::DECODE_TYPE_DEFAULT); $queryParams = $this->filterParams([ 'query' => $searchQuery, 'regionId' => $regionId, 'page' => $page, 'pageSize' => $pageSize, 'currency' => $currency, ]); $response = $this->sendRequest('GET', $this->getServiceUrl($resource), ['query' => $queryParams]); $decodedResponseBody = $this->getDecodedBody($response->getBody()); return new GetMarketModelsResponse($decodedResponseBody); }
php
public function findModels($searchQuery, $regionId, $page = null, $pageSize = null, $currency = null) { $resource = sprintf('models.%s', self::DECODE_TYPE_DEFAULT); $queryParams = $this->filterParams([ 'query' => $searchQuery, 'regionId' => $regionId, 'page' => $page, 'pageSize' => $pageSize, 'currency' => $currency, ]); $response = $this->sendRequest('GET', $this->getServiceUrl($resource), ['query' => $queryParams]); $decodedResponseBody = $this->getDecodedBody($response->getBody()); return new GetMarketModelsResponse($decodedResponseBody); }
[ "public", "function", "findModels", "(", "$", "searchQuery", ",", "$", "regionId", ",", "$", "page", "=", "null", ",", "$", "pageSize", "=", "null", ",", "$", "currency", "=", "null", ")", "{", "$", "resource", "=", "sprintf", "(", "'models.%s'", ",", ...
Find models by query @param string $searchQuery @param int $regionId @param int $page @param int $pageSize @param string $currency @return GetMarketModelsResponse @link https://tech.yandex.ru/market/partner/doc/dg/reference/get-models-docpage/
[ "Find", "models", "by", "query" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Partner/PartnerClient.php#L640-L655
train
nixsolutions/yandex-php-library
src/Yandex/Market/Partner/PartnerClient.php
PartnerClient.getModelOffers
public function getModelOffers($modelId, $regionId, $currency = null, $orderByPrice = null) { $resource = sprintf('models/%s/offers.%s', $modelId, self::DECODE_TYPE_DEFAULT); $queryParams = $this->filterParams([ 'regionId' => $regionId, 'currency' => $currency, 'orderByPrice' => $orderByPrice, ]); $response = $this->sendRequest('GET', $this->getServiceUrl($resource), ['query' => $queryParams]); $decodedResponseBody = $this->getDecodedBody($response->getBody()); $marketModelsResponse = new GetMarketModelsResponse($decodedResponseBody); return $marketModelsResponse->getModels()->current(); }
php
public function getModelOffers($modelId, $regionId, $currency = null, $orderByPrice = null) { $resource = sprintf('models/%s/offers.%s', $modelId, self::DECODE_TYPE_DEFAULT); $queryParams = $this->filterParams([ 'regionId' => $regionId, 'currency' => $currency, 'orderByPrice' => $orderByPrice, ]); $response = $this->sendRequest('GET', $this->getServiceUrl($resource), ['query' => $queryParams]); $decodedResponseBody = $this->getDecodedBody($response->getBody()); $marketModelsResponse = new GetMarketModelsResponse($decodedResponseBody); return $marketModelsResponse->getModels()->current(); }
[ "public", "function", "getModelOffers", "(", "$", "modelId", ",", "$", "regionId", ",", "$", "currency", "=", "null", ",", "$", "orderByPrice", "=", "null", ")", "{", "$", "resource", "=", "sprintf", "(", "'models/%s/offers.%s'", ",", "$", "modelId", ",", ...
Get model offers @param int $modelId @param int $regionId @param string $currency @param string $orderByPrice @return MarketModel @link https://tech.yandex.ru/market/partner/doc/dg/reference/get-models-id-offers-docpage/
[ "Get", "model", "offers" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Partner/PartnerClient.php#L698-L712
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/Clients/GeoRegionClient.php
GeoRegionClient.getList
public function getList($params = array()) { $resource = 'georegion.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $geoRegions = new Models\ResponseGeoRegionsGet($response); return $geoRegions; }
php
public function getList($params = array()) { $resource = 'georegion.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $geoRegions = new Models\ResponseGeoRegionsGet($response); return $geoRegions; }
[ "public", "function", "getList", "(", "$", "params", "=", "array", "(", ")", ")", "{", "$", "resource", "=", "'georegion.json'", ";", "$", "resource", ".=", "'?'", ".", "$", "this", "->", "buildQueryString", "(", "$", "params", ")", ";", "$", "response...
Get geo regions Returns geo regions list of Yandex.Market service according to params. @see https://tech.yandex.ru/market/content-data/doc/dg/reference/georegion-docpage/ @param array $params @return Models\ResponseGeoRegionsGet
[ "Get", "geo", "regions" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/Clients/GeoRegionClient.php#L39-L48
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/Clients/GeoRegionClient.php
GeoRegionClient.get
public function get($regionId) { $resource = 'georegion/' . $regionId . '.json'; $response = $this->getServiceResponse($resource); $geoRegion = new Models\ResponseGeoRegionGet($response); return $geoRegion; }
php
public function get($regionId) { $resource = 'georegion/' . $regionId . '.json'; $response = $this->getServiceResponse($resource); $geoRegion = new Models\ResponseGeoRegionGet($response); return $geoRegion; }
[ "public", "function", "get", "(", "$", "regionId", ")", "{", "$", "resource", "=", "'georegion/'", ".", "$", "regionId", ".", "'.json'", ";", "$", "response", "=", "$", "this", "->", "getServiceResponse", "(", "$", "resource", ")", ";", "$", "geoRegion",...
Get geo region information Returns geo region of Yandex.Market service. @see https://tech.yandex.ru/market/content-data/doc/dg/reference/georegion-id-docpage/ @param int $regionId @return Models\ResponseGeoRegionGet
[ "Get", "geo", "region", "information" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/Clients/GeoRegionClient.php#L61-L69
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/Clients/GeoRegionClient.php
GeoRegionClient.getChildren
public function getChildren($regionId, $params = array()) { $resource = 'georegion/' . $regionId . '/children.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $geoRegionChildren = new Models\ResponseGeoRegionChildrenGet($response); return $geoRegionChildren; }
php
public function getChildren($regionId, $params = array()) { $resource = 'georegion/' . $regionId . '/children.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $geoRegionChildren = new Models\ResponseGeoRegionChildrenGet($response); return $geoRegionChildren; }
[ "public", "function", "getChildren", "(", "$", "regionId", ",", "$", "params", "=", "array", "(", ")", ")", "{", "$", "resource", "=", "'georegion/'", ".", "$", "regionId", ".", "'/children.json'", ";", "$", "resource", ".=", "'?'", ".", "$", "this", "...
Get children of geo region Returns children list of Yandex.Market service geo region. @see https://tech.yandex.ru/market/content-data/doc/dg/reference/georegion-id-children-docpage/ @param int $regionId @param array $params @return Models\ResponseGeoRegionChildrenGet
[ "Get", "children", "of", "geo", "region" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/Clients/GeoRegionClient.php#L83-L92
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/Clients/GeoRegionClient.php
GeoRegionClient.getMatch
public function getMatch($params = array()) { $resource = 'georegion/suggest.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $geoRegionsSuggest = new Models\ResponseGeoRegionSuggestGet($response); return $geoRegionsSuggest; }
php
public function getMatch($params = array()) { $resource = 'georegion/suggest.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $geoRegionsSuggest = new Models\ResponseGeoRegionSuggestGet($response); return $geoRegionsSuggest; }
[ "public", "function", "getMatch", "(", "$", "params", "=", "array", "(", ")", ")", "{", "$", "resource", "=", "'georegion/suggest.json'", ";", "$", "resource", ".=", "'?'", ".", "$", "this", "->", "buildQueryString", "(", "$", "params", ")", ";", "$", ...
Get suggests of geo region Returns suggests list of geo region in Yandex.Market service. @see https://tech.yandex.ru/market/content-data/doc/dg/reference/georegion-suggest-docpage/ @param array $params @return Models\ResponseGeoRegionSuggestGet
[ "Get", "suggests", "of", "geo", "region" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/Clients/GeoRegionClient.php#L105-L114
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/Clients/GeoRegionClient.php
GeoRegionClient.getShopsSummary
public function getShopsSummary($regionId, $params = array()) { $resource = 'regions/' . $regionId . '/shops/summary.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $regionShopsSummary = new Models\ResponseGeoRegionShopsSummaryGet($response); return $regionShopsSummary; }
php
public function getShopsSummary($regionId, $params = array()) { $resource = 'regions/' . $regionId . '/shops/summary.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $regionShopsSummary = new Models\ResponseGeoRegionShopsSummaryGet($response); return $regionShopsSummary; }
[ "public", "function", "getShopsSummary", "(", "$", "regionId", ",", "$", "params", "=", "array", "(", ")", ")", "{", "$", "resource", "=", "'regions/'", ".", "$", "regionId", ".", "'/shops/summary.json'", ";", "$", "resource", ".=", "'?'", ".", "$", "thi...
Get shops summary in geo region Returns shops summary information of Yandex.Market service in geo region. @see https://tech.yandex.ru/market/content-data/doc/dg/reference/regions-id-shops-summary-docpage/ @param int $regionId @param array $params @return Models\ResponseGeoRegionShopsSummaryGet
[ "Get", "shops", "summary", "in", "geo", "region" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/Clients/GeoRegionClient.php#L128-L137
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/Clients/PopularClient.php
PopularClient.getModels
public function getModels($params = array()) { $resource = 'popular.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $getPopularModelsResponse = new Models\ResponsePopularModelsGet($response); return $getPopularModelsResponse; }
php
public function getModels($params = array()) { $resource = 'popular.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $getPopularModelsResponse = new Models\ResponsePopularModelsGet($response); return $getPopularModelsResponse; }
[ "public", "function", "getModels", "(", "$", "params", "=", "array", "(", ")", ")", "{", "$", "resource", "=", "'popular.json'", ";", "$", "resource", ".=", "'?'", ".", "$", "this", "->", "buildQueryString", "(", "$", "params", ")", ";", "$", "response...
Get popular models Returns popular models of Yandex.Market service according to params. @see https://tech.yandex.ru/market/content-data/doc/dg/reference/popular-docpage/ @param array $params @return Models\ResponsePopularModelsGet
[ "Get", "popular", "models" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/Clients/PopularClient.php#L39-L48
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/Clients/PopularClient.php
PopularClient.getCategoryModels
public function getCategoryModels($categoryId, $params = array()) { $resource = 'popular/' . $categoryId . '.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $getPopularCategoryModelsResponse = new Models\ResponsePopularCategoryModelsGet($response); return $getPopularCategoryModelsResponse; }
php
public function getCategoryModels($categoryId, $params = array()) { $resource = 'popular/' . $categoryId . '.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $getPopularCategoryModelsResponse = new Models\ResponsePopularCategoryModelsGet($response); return $getPopularCategoryModelsResponse; }
[ "public", "function", "getCategoryModels", "(", "$", "categoryId", ",", "$", "params", "=", "array", "(", ")", ")", "{", "$", "resource", "=", "'popular/'", ".", "$", "categoryId", ".", "'.json'", ";", "$", "resource", ".=", "'?'", ".", "$", "this", "-...
Get popular category models Returns popular category models of Yandex.Market service according to params. @see https://tech.yandex.ru/market/content-data/doc/dg/reference/popular-category-id-docpage/ @param int $categoryId @param array $params @return Models\ResponsePopularCategoryModelsGet
[ "Get", "popular", "category", "models" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/Clients/PopularClient.php#L62-L71
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/Models/DeliveryMethods.php
DeliveryMethods.add
public function add($method) { if (is_array($method)) { $this->collection[] = new DeliveryMethod($method); } elseif (is_object($method) && $method instanceof DeliveryMethod) { $this->collection[] = $method; } return $this; }
php
public function add($method) { if (is_array($method)) { $this->collection[] = new DeliveryMethod($method); } elseif (is_object($method) && $method instanceof DeliveryMethod) { $this->collection[] = $method; } return $this; }
[ "public", "function", "add", "(", "$", "method", ")", "{", "if", "(", "is_array", "(", "$", "method", ")", ")", "{", "$", "this", "->", "collection", "[", "]", "=", "new", "DeliveryMethod", "(", "$", "method", ")", ";", "}", "elseif", "(", "is_obje...
Add method to collection @param DeliveryMethod|array $method @return DeliveryMethods
[ "Add", "method", "to", "collection" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/Models/DeliveryMethods.php#L16-L25
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/Models/Contras.php
Contras.add
public function add($fact) { if (is_string($fact)) { $this->collection[] = new Fact(array('fact'=>$fact)); } elseif (is_object($fact) && $fact instanceof Fact) { $this->collection[] = $fact; } return $this; }
php
public function add($fact) { if (is_string($fact)) { $this->collection[] = new Fact(array('fact'=>$fact)); } elseif (is_object($fact) && $fact instanceof Fact) { $this->collection[] = $fact; } return $this; }
[ "public", "function", "add", "(", "$", "fact", ")", "{", "if", "(", "is_string", "(", "$", "fact", ")", ")", "{", "$", "this", "->", "collection", "[", "]", "=", "new", "Fact", "(", "array", "(", "'fact'", "=>", "$", "fact", ")", ")", ";", "}",...
Add fact to collection @param Fact|array $fact @return Contras
[ "Add", "fact", "to", "collection" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/Models/Contras.php#L16-L25
train
nixsolutions/yandex-php-library
src/Yandex/Market/Partner/Models/MarketModelOffers.php
MarketModelOffers.add
public function add($offer) { if (is_array($offer)) { $this->collection[] = new MarketModelOffer($offer); } elseif ($offer instanceof MarketModelOffer) { $this->collection[] = $offer; } return $this; }
php
public function add($offer) { if (is_array($offer)) { $this->collection[] = new MarketModelOffer($offer); } elseif ($offer instanceof MarketModelOffer) { $this->collection[] = $offer; } return $this; }
[ "public", "function", "add", "(", "$", "offer", ")", "{", "if", "(", "is_array", "(", "$", "offer", ")", ")", "{", "$", "this", "->", "collection", "[", "]", "=", "new", "MarketModelOffer", "(", "$", "offer", ")", ";", "}", "elseif", "(", "$", "o...
Add model offer @param array|MarketModelOffer $offer @return MarketModelOffers
[ "Add", "model", "offer" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Partner/Models/MarketModelOffers.php#L21-L30
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/Clients/ShopClient.php
ShopClient.get
public function get($shopId) { $resource = 'shop/' . $shopId . '.json'; $response = $this->getServiceResponse($resource); $getShopResponse = new Models\ResponseShopGet($response); return $getShopResponse->getShop(); }
php
public function get($shopId) { $resource = 'shop/' . $shopId . '.json'; $response = $this->getServiceResponse($resource); $getShopResponse = new Models\ResponseShopGet($response); return $getShopResponse->getShop(); }
[ "public", "function", "get", "(", "$", "shopId", ")", "{", "$", "resource", "=", "'shop/'", ".", "$", "shopId", ".", "'.json'", ";", "$", "response", "=", "$", "this", "->", "getServiceResponse", "(", "$", "resource", ")", ";", "$", "getShopResponse", ...
Get shop information Returns shop of Yandex.Market. @see https://tech.yandex.ru/market/content-data/doc/dg/reference/shop-id-docpage/ @param int $shopId @return Models\Shop
[ "Get", "shop", "information" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/Clients/ShopClient.php#L61-L69
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/Clients/ShopClient.php
ShopClient.getOutlets
public function getOutlets($shopId, $params = array()) { $resource = 'shop/' . $shopId . '/outlets.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $shopOutlets = new Models\ResponseShopOutletsGet($response); return $shopOutlets; }
php
public function getOutlets($shopId, $params = array()) { $resource = 'shop/' . $shopId . '/outlets.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $shopOutlets = new Models\ResponseShopOutletsGet($response); return $shopOutlets; }
[ "public", "function", "getOutlets", "(", "$", "shopId", ",", "$", "params", "=", "array", "(", ")", ")", "{", "$", "resource", "=", "'shop/'", ".", "$", "shopId", ".", "'/outlets.json'", ";", "$", "resource", ".=", "'?'", ".", "$", "this", "->", "bui...
Get outlets of shop Returns outlets of Yandex.Market service shop according to params. @see https://tech.yandex.ru/market/content-data/doc/dg/reference/shop-id-outlets-docpage/ @param int $shopId @param array $params @return Models\ResponseShopOutletsGet
[ "Get", "outlets", "of", "shop" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/Clients/ShopClient.php#L83-L92
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/Clients/ShopClient.php
ShopClient.getOpinions
public function getOpinions($shopId, $params = array()) { $resource = 'shop/' . $shopId . '/opinion.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $shopOpinions = new Models\ResponseShopOpinionsGet($response); return $shopOpinions; }
php
public function getOpinions($shopId, $params = array()) { $resource = 'shop/' . $shopId . '/opinion.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $shopOpinions = new Models\ResponseShopOpinionsGet($response); return $shopOpinions; }
[ "public", "function", "getOpinions", "(", "$", "shopId", ",", "$", "params", "=", "array", "(", ")", ")", "{", "$", "resource", "=", "'shop/'", ".", "$", "shopId", ".", "'/opinion.json'", ";", "$", "resource", ".=", "'?'", ".", "$", "this", "->", "bu...
Get opinions of shop Returns opinions list of Yandex.Market service shop. @see https://tech.yandex.ru/market/content-data/doc/dg/reference/shop-id-opinion-docpage/ @param int $shopId @param array $params @return Models\ResponseShopOpinionsGet
[ "Get", "opinions", "of", "shop" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/Clients/ShopClient.php#L106-L115
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/Clients/VendorClient.php
VendorClient.get
public function get($vendorId) { $resource = 'vendor/' . $vendorId . '.json'; $response = $this->getServiceResponse($resource); $getVendorResponse = new Models\ResponseVendorGet($response); return $getVendorResponse; }
php
public function get($vendorId) { $resource = 'vendor/' . $vendorId . '.json'; $response = $this->getServiceResponse($resource); $getVendorResponse = new Models\ResponseVendorGet($response); return $getVendorResponse; }
[ "public", "function", "get", "(", "$", "vendorId", ")", "{", "$", "resource", "=", "'vendor/'", ".", "$", "vendorId", ".", "'.json'", ";", "$", "response", "=", "$", "this", "->", "getServiceResponse", "(", "$", "resource", ")", ";", "$", "getVendorRespo...
Get vendor information Returns vendor of Yandex.Market service according to params. @see https://tech.yandex.ru/market/content-data/doc/dg/reference/vendor-id-docpage/ @param int $vendorId @return Models\ResponseVendorGet
[ "Get", "vendor", "information" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/Clients/VendorClient.php#L61-L69
train
nixsolutions/yandex-php-library
src/Yandex/SafeBrowsing/SafeBrowsingClient.php
SafeBrowsingClient.getLookupUrl
public function getLookupUrl($url = '') { $pVer = '3.5'; //Specific version return $this->serviceScheme . '://' . $this->serviceDomain . '/' . 'lookup?client=api&apikey=' . $this->apiKey . '&pver=' . $pVer . '&url=' . $url; }
php
public function getLookupUrl($url = '') { $pVer = '3.5'; //Specific version return $this->serviceScheme . '://' . $this->serviceDomain . '/' . 'lookup?client=api&apikey=' . $this->apiKey . '&pver=' . $pVer . '&url=' . $url; }
[ "public", "function", "getLookupUrl", "(", "$", "url", "=", "''", ")", "{", "$", "pVer", "=", "'3.5'", ";", "//Specific version", "return", "$", "this", "->", "serviceScheme", ".", "'://'", ".", "$", "this", "->", "serviceDomain", ".", "'/'", ".", "'look...
Get url to service Lookup resource with parameters @param string $url @return string
[ "Get", "url", "to", "service", "Lookup", "resource", "with", "parameters" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/SafeBrowsing/SafeBrowsingClient.php#L120-L125
train
nixsolutions/yandex-php-library
src/Yandex/Metrica/Management/FiltersClient.php
FiltersClient.getFilters
public function getFilters($counterId) { $resource = 'counter/' . $counterId . '/filters'; $response = $this->sendGetRequest($resource); $filterResponse = new Models\GetFiltersResponse($response); return $filterResponse->getFilters(); }
php
public function getFilters($counterId) { $resource = 'counter/' . $counterId . '/filters'; $response = $this->sendGetRequest($resource); $filterResponse = new Models\GetFiltersResponse($response); return $filterResponse->getFilters(); }
[ "public", "function", "getFilters", "(", "$", "counterId", ")", "{", "$", "resource", "=", "'counter/'", ".", "$", "counterId", ".", "'/filters'", ";", "$", "response", "=", "$", "this", "->", "sendGetRequest", "(", "$", "resource", ")", ";", "$", "filte...
Get counter filters @see http://api.yandex.ru/metrika/doc/beta/management/filters/filters.xml @param int $counterId @return array
[ "Get", "counter", "filters" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Metrica/Management/FiltersClient.php#L24-L30
train
nixsolutions/yandex-php-library
src/Yandex/Metrica/Management/FiltersClient.php
FiltersClient.addFilter
public function addFilter($counterId, Models\Filter $filter) { $resource = 'counter/' . $counterId . '/filters'; $response = $this->sendPostRequest($resource, ["filter" => $filter->toArray()]); $filterResponse = new Models\AddFilterResponse($response); return $filterResponse->getFilter(); }
php
public function addFilter($counterId, Models\Filter $filter) { $resource = 'counter/' . $counterId . '/filters'; $response = $this->sendPostRequest($resource, ["filter" => $filter->toArray()]); $filterResponse = new Models\AddFilterResponse($response); return $filterResponse->getFilter(); }
[ "public", "function", "addFilter", "(", "$", "counterId", ",", "Models", "\\", "Filter", "$", "filter", ")", "{", "$", "resource", "=", "'counter/'", ".", "$", "counterId", ".", "'/filters'", ";", "$", "response", "=", "$", "this", "->", "sendPostRequest",...
Add filter to counter @see http://api.yandex.ru/metrika/doc/beta/management/filters/addfilter.xml @param int $counterId @param Models\Filter $filter @return array
[ "Add", "filter", "to", "counter" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Metrica/Management/FiltersClient.php#L42-L48
train
nixsolutions/yandex-php-library
src/Yandex/Metrica/Management/FiltersClient.php
FiltersClient.getFilter
public function getFilter($id, $counterId, $params = []) { $resource = 'counter/' . $counterId . '/filter/' . $id; $response = $this->sendGetRequest($resource, $params); $filterResponse = new Models\GetFilterResponse($response); return $filterResponse->getFilter(); }
php
public function getFilter($id, $counterId, $params = []) { $resource = 'counter/' . $counterId . '/filter/' . $id; $response = $this->sendGetRequest($resource, $params); $filterResponse = new Models\GetFilterResponse($response); return $filterResponse->getFilter(); }
[ "public", "function", "getFilter", "(", "$", "id", ",", "$", "counterId", ",", "$", "params", "=", "[", "]", ")", "{", "$", "resource", "=", "'counter/'", ".", "$", "counterId", ".", "'/filter/'", ".", "$", "id", ";", "$", "response", "=", "$", "th...
Get counter filter @see http://api.yandex.ru/metrika/doc/beta/management/filters/filter.xml @param int $id @param int $counterId @param array $params @return array
[ "Get", "counter", "filter" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Metrica/Management/FiltersClient.php#L61-L67
train
nixsolutions/yandex-php-library
src/Yandex/Metrica/Management/FiltersClient.php
FiltersClient.updateFilter
public function updateFilter($id, $counterId, Models\Filter $filter) { $resource = 'counter/' . $counterId . '/filter/' . $id; $response = $this->sendPutRequest($resource, ["filter" => $filter->toArray()]); $filterResponse = new Models\UpdateFilterResponse($response); return $filterResponse->getFilter(); }
php
public function updateFilter($id, $counterId, Models\Filter $filter) { $resource = 'counter/' . $counterId . '/filter/' . $id; $response = $this->sendPutRequest($resource, ["filter" => $filter->toArray()]); $filterResponse = new Models\UpdateFilterResponse($response); return $filterResponse->getFilter(); }
[ "public", "function", "updateFilter", "(", "$", "id", ",", "$", "counterId", ",", "Models", "\\", "Filter", "$", "filter", ")", "{", "$", "resource", "=", "'counter/'", ".", "$", "counterId", ".", "'/filter/'", ".", "$", "id", ";", "$", "response", "="...
Update counter filter @see http://api.yandex.ru/metrika/doc/beta/management/filters/editfilter.xml @param int $id @param int $counterId @param Models\Filter $filter @return array
[ "Update", "counter", "filter" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Metrica/Management/FiltersClient.php#L80-L86
train
nixsolutions/yandex-php-library
src/Yandex/Metrica/Management/FiltersClient.php
FiltersClient.deleteFilter
public function deleteFilter($id, $counterId) { $resource = 'counter/' . $counterId . '/filter/' . $id; $response = $this->sendDeleteRequest($resource); return $response; }
php
public function deleteFilter($id, $counterId) { $resource = 'counter/' . $counterId . '/filter/' . $id; $response = $this->sendDeleteRequest($resource); return $response; }
[ "public", "function", "deleteFilter", "(", "$", "id", ",", "$", "counterId", ")", "{", "$", "resource", "=", "'counter/'", ".", "$", "counterId", ".", "'/filter/'", ".", "$", "id", ";", "$", "response", "=", "$", "this", "->", "sendDeleteRequest", "(", ...
Delete counter filter @see http://api.yandex.ru/metrika/doc/ref/reference/del-counter-filter.xml @param int $id @param int $counterId @return array
[ "Delete", "counter", "filter" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Metrica/Management/FiltersClient.php#L98-L103
train
nixsolutions/yandex-php-library
src/Yandex/Metrica/Analytics/GaClient.php
GaClient.getGaData
public function getGaData(Models\Params $params) { $resource = 'ga'; $response = $this->sendGetRequest($resource, $params->toArray()); $responseObj = new Models\Ga($response); return $responseObj; }
php
public function getGaData(Models\Params $params) { $resource = 'ga'; $response = $this->sendGetRequest($resource, $params->toArray()); $responseObj = new Models\Ga($response); return $responseObj; }
[ "public", "function", "getGaData", "(", "Models", "\\", "Params", "$", "params", ")", "{", "$", "resource", "=", "'ga'", ";", "$", "response", "=", "$", "this", "->", "sendGetRequest", "(", "$", "resource", ",", "$", "params", "->", "toArray", "(", ")"...
Get google analytics data @see http://api.yandex.ru/metrika/doc/beta/ga/queries/requestjson.xml @param Models\Params $params @return Models\Ga
[ "Get", "google", "analytics", "data" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Metrica/Analytics/GaClient.php#L25-L32
train
nixsolutions/yandex-php-library
src/Yandex/Metrica/Management/GrantsClient.php
GrantsClient.getGrants
public function getGrants($counterId, $params = []) { $resource = 'counter/' . $counterId . '/grants'; $response = $this->sendGetRequest($resource, $params); $grantResponse = new Models\GetGrantsResponse($response); return $grantResponse->getGrants(); }
php
public function getGrants($counterId, $params = []) { $resource = 'counter/' . $counterId . '/grants'; $response = $this->sendGetRequest($resource, $params); $grantResponse = new Models\GetGrantsResponse($response); return $grantResponse->getGrants(); }
[ "public", "function", "getGrants", "(", "$", "counterId", ",", "$", "params", "=", "[", "]", ")", "{", "$", "resource", "=", "'counter/'", ".", "$", "counterId", ".", "'/grants'", ";", "$", "response", "=", "$", "this", "->", "sendGetRequest", "(", "$"...
Get counter grants @see http://api.yandex.ru/metrika/doc/beta/management/grants/grants.xml @param int $counterId @param array $params @return array
[ "Get", "counter", "grants" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Metrica/Management/GrantsClient.php#L25-L31
train
nixsolutions/yandex-php-library
src/Yandex/Metrica/Management/GrantsClient.php
GrantsClient.addGrant
public function addGrant($counterId, Models\Grant $grant) { $resource = 'counter/' . $counterId . '/grants'; $response = $this->sendPostRequest($resource, ["grant" => $grant->toArray()]); $grantResponse = new Models\AddGrantResponse($response); return $grantResponse->getGrant(); }
php
public function addGrant($counterId, Models\Grant $grant) { $resource = 'counter/' . $counterId . '/grants'; $response = $this->sendPostRequest($resource, ["grant" => $grant->toArray()]); $grantResponse = new Models\AddGrantResponse($response); return $grantResponse->getGrant(); }
[ "public", "function", "addGrant", "(", "$", "counterId", ",", "Models", "\\", "Grant", "$", "grant", ")", "{", "$", "resource", "=", "'counter/'", ".", "$", "counterId", ".", "'/grants'", ";", "$", "response", "=", "$", "this", "->", "sendPostRequest", "...
Add grant to counter @see http://api.yandex.ru/metrika/doc/beta/management/grants/addgrant.xml @param int $counterId @param Models\Grant $grant @return Models\Grant
[ "Add", "grant", "to", "counter" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Metrica/Management/GrantsClient.php#L43-L49
train
nixsolutions/yandex-php-library
src/Yandex/Metrica/Management/GrantsClient.php
GrantsClient.getGrant
public function getGrant($counterId, $userLogin, $params = []) { $resource = 'counter/' . $counterId . '/grant/' . $userLogin; $response = $this->sendGetRequest($resource, $params); $grantResponse = new Models\GetGrantResponse($response); return $grantResponse->getGrant(); }
php
public function getGrant($counterId, $userLogin, $params = []) { $resource = 'counter/' . $counterId . '/grant/' . $userLogin; $response = $this->sendGetRequest($resource, $params); $grantResponse = new Models\GetGrantResponse($response); return $grantResponse->getGrant(); }
[ "public", "function", "getGrant", "(", "$", "counterId", ",", "$", "userLogin", ",", "$", "params", "=", "[", "]", ")", "{", "$", "resource", "=", "'counter/'", ".", "$", "counterId", ".", "'/grant/'", ".", "$", "userLogin", ";", "$", "response", "=", ...
Get counter grant @see http://api.yandex.ru/metrika/doc/beta/management/grants/grantold.xml @param int $counterId @param string $userLogin @param array $params @return Models\Grant
[ "Get", "counter", "grant" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Metrica/Management/GrantsClient.php#L62-L68
train
nixsolutions/yandex-php-library
src/Yandex/Metrica/Management/GrantsClient.php
GrantsClient.updateGrant
public function updateGrant($counterId, $userLogin, Models\Grant $grant) { $resource = 'counter/' . $counterId . '/grant/' . $userLogin; $response = $this->sendPutRequest($resource, ["grant" => $grant->toArray()]); $grantResponse = new Models\UpdateGrantResponse($response); return $grantResponse->getGrant(); }
php
public function updateGrant($counterId, $userLogin, Models\Grant $grant) { $resource = 'counter/' . $counterId . '/grant/' . $userLogin; $response = $this->sendPutRequest($resource, ["grant" => $grant->toArray()]); $grantResponse = new Models\UpdateGrantResponse($response); return $grantResponse->getGrant(); }
[ "public", "function", "updateGrant", "(", "$", "counterId", ",", "$", "userLogin", ",", "Models", "\\", "Grant", "$", "grant", ")", "{", "$", "resource", "=", "'counter/'", ".", "$", "counterId", ".", "'/grant/'", ".", "$", "userLogin", ";", "$", "respon...
Update counter grant @see http://api.yandex.ru/metrika/doc/beta/management/grants/editgrantold.xml @param int $counterId @param string $userLogin @param Models\Grant $grant @return Models\Grant
[ "Update", "counter", "grant" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Metrica/Management/GrantsClient.php#L81-L87
train
nixsolutions/yandex-php-library
src/Yandex/Metrica/Management/GrantsClient.php
GrantsClient.deleteGrant
public function deleteGrant($counterId, $userLogin) { $resource = 'counter/' . $counterId . '/grant/' . $userLogin; $response = $this->sendDeleteRequest($resource); return $response; }
php
public function deleteGrant($counterId, $userLogin) { $resource = 'counter/' . $counterId . '/grant/' . $userLogin; $response = $this->sendDeleteRequest($resource); return $response; }
[ "public", "function", "deleteGrant", "(", "$", "counterId", ",", "$", "userLogin", ")", "{", "$", "resource", "=", "'counter/'", ".", "$", "counterId", ".", "'/grant/'", ".", "$", "userLogin", ";", "$", "response", "=", "$", "this", "->", "sendDeleteReques...
Delete counter grant @see http://api.yandex.ru/metrika/doc/ref/reference/del-counter-grant.xml @param int $counterId @param string $userLogin @return array
[ "Delete", "counter", "grant" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Metrica/Management/GrantsClient.php#L99-L104
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/Clients/OfferClient.php
OfferClient.get
public function get($offerId, $params = array()) { $resource = 'offer/' . $offerId . '.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $getOfferResponse = new Models\ResponseOfferGet($response); return $getOfferResponse; }
php
public function get($offerId, $params = array()) { $resource = 'offer/' . $offerId . '.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $getOfferResponse = new Models\ResponseOfferGet($response); return $getOfferResponse; }
[ "public", "function", "get", "(", "$", "offerId", ",", "$", "params", "=", "array", "(", ")", ")", "{", "$", "resource", "=", "'offer/'", ".", "$", "offerId", ".", "'.json'", ";", "$", "resource", ".=", "'?'", ".", "$", "this", "->", "buildQueryStrin...
Get offer information Returns offer of Yandex.Market service according to params. @see https://tech.yandex.ru/market/content-data/doc/dg/reference/offer-id-docpage/ @param string $offerId @param array $params @return Models\ResponseOfferGet
[ "Get", "offer", "information" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/Clients/OfferClient.php#L40-L49
train
nixsolutions/yandex-php-library
src/Yandex/Dictionary/DictionaryClient.php
DictionaryClient.lookup
public function lookup($text) { $url = $this->getLookupUrl($text); $response = $this->sendRequest( 'GET', $url, [ 'version' => $this->serviceProtocolVersion ] ); if ($response->getStatusCode() === 200) { $definitions = $this->parseLookupResponse($response); return $definitions; } return false; }
php
public function lookup($text) { $url = $this->getLookupUrl($text); $response = $this->sendRequest( 'GET', $url, [ 'version' => $this->serviceProtocolVersion ] ); if ($response->getStatusCode() === 200) { $definitions = $this->parseLookupResponse($response); return $definitions; } return false; }
[ "public", "function", "lookup", "(", "$", "text", ")", "{", "$", "url", "=", "$", "this", "->", "getLookupUrl", "(", "$", "text", ")", ";", "$", "response", "=", "$", "this", "->", "sendRequest", "(", "'GET'", ",", "$", "url", ",", "[", "'version'"...
Looks up a text in the dictionary @param string $text @return array|bool @throws DictionaryException @throws ForbiddenException
[ "Looks", "up", "a", "text", "in", "the", "dictionary" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Dictionary/DictionaryClient.php#L282-L297
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/Clients/SearchClient.php
SearchClient.get
public function get($params = array()) { $resource = 'search.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $getSearchResponse = new Models\ResponseSearchGet($response); return $getSearchResponse; }
php
public function get($params = array()) { $resource = 'search.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $getSearchResponse = new Models\ResponseSearchGet($response); return $getSearchResponse; }
[ "public", "function", "get", "(", "$", "params", "=", "array", "(", ")", ")", "{", "$", "resource", "=", "'search.json'", ";", "$", "resource", ".=", "'?'", ".", "$", "this", "->", "buildQueryString", "(", "$", "params", ")", ";", "$", "response", "=...
Get models & offers search result Returns models and offers of Yandex.Market service search result according to params. @see https://tech.yandex.ru/market/content-data/doc/dg/reference/search-docpage/ @param array $params @return Models\ResponseSearchGet
[ "Get", "models", "&", "offers", "search", "result" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/Clients/SearchClient.php#L39-L48
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/Clients/SearchClient.php
SearchClient.getFilterCategory
public function getFilterCategory($categoryId, $params = array()) { $resource = 'filter/' . $categoryId. '.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $getFilterCategoryResponse = new Models\ResponseFilterCategoryGet($response); return $getFilterCategoryResponse; }
php
public function getFilterCategory($categoryId, $params = array()) { $resource = 'filter/' . $categoryId. '.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $getFilterCategoryResponse = new Models\ResponseFilterCategoryGet($response); return $getFilterCategoryResponse; }
[ "public", "function", "getFilterCategory", "(", "$", "categoryId", ",", "$", "params", "=", "array", "(", ")", ")", "{", "$", "resource", "=", "'filter/'", ".", "$", "categoryId", ".", "'.json'", ";", "$", "resource", ".=", "'?'", ".", "$", "this", "->...
Get models & offers search by filters result Returns models and offers of Yandex.Market service search by filters result according to params. @see https://tech.yandex.ru/market/content-data/doc/dg/reference/filter-id-docpage/ @param int $categoryId @param array $params @return Models\ResponseFilterCategoryGet
[ "Get", "models", "&", "offers", "search", "by", "filters", "result" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/Clients/SearchClient.php#L62-L71
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/Clients/CategoryClient.php
CategoryClient.get
public function get($categoryId, $params = array()) { $resource = 'category/' . $categoryId . '.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $getCategoryResponse = new Models\ResponseCategoryGet($response); return $getCategoryResponse->getCategory(); }
php
public function get($categoryId, $params = array()) { $resource = 'category/' . $categoryId . '.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $getCategoryResponse = new Models\ResponseCategoryGet($response); return $getCategoryResponse->getCategory(); }
[ "public", "function", "get", "(", "$", "categoryId", ",", "$", "params", "=", "array", "(", ")", ")", "{", "$", "resource", "=", "'category/'", ".", "$", "categoryId", ".", "'.json'", ";", "$", "resource", ".=", "'?'", ".", "$", "this", "->", "buildQ...
Get category information Returns category of Yandex.Market service according to params. @see https://tech.yandex.ru/market/content-data/doc/dg/reference/category-id-docpage/ @param int $categoryId @param array $params @return Models\Category
[ "Get", "category", "information" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/Clients/CategoryClient.php#L62-L71
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/Clients/CategoryClient.php
CategoryClient.getChildren
public function getChildren($categoryId, $params = array()) { $resource = 'category/' . $categoryId . '/children.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $getCategoryResponse = new Models\ResponseCategoryGetList($response); return $getCategoryResponse; }
php
public function getChildren($categoryId, $params = array()) { $resource = 'category/' . $categoryId . '/children.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $getCategoryResponse = new Models\ResponseCategoryGetList($response); return $getCategoryResponse; }
[ "public", "function", "getChildren", "(", "$", "categoryId", ",", "$", "params", "=", "array", "(", ")", ")", "{", "$", "resource", "=", "'category/'", ".", "$", "categoryId", ".", "'/children.json'", ";", "$", "resource", ".=", "'?'", ".", "$", "this", ...
Get children categories Returns children categories list of Yandex.Market service according to params. @see https://tech.yandex.ru/market/content-data/doc/dg/reference/category-id-children-docpage/ @param int $categoryId @param array $params @return Models\ResponseCategoryGetList
[ "Get", "children", "categories" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/Clients/CategoryClient.php#L85-L94
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/Clients/CategoryClient.php
CategoryClient.getModels
public function getModels($categoryId, $params = array()) { $resource = 'category/' . $categoryId . '/models.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $getCategoryModelsResponse = new Models\ResponseCategoryGetModels($response); return $getCategoryModelsResponse; }
php
public function getModels($categoryId, $params = array()) { $resource = 'category/' . $categoryId . '/models.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $getCategoryModelsResponse = new Models\ResponseCategoryGetModels($response); return $getCategoryModelsResponse; }
[ "public", "function", "getModels", "(", "$", "categoryId", ",", "$", "params", "=", "array", "(", ")", ")", "{", "$", "resource", "=", "'category/'", ".", "$", "categoryId", ".", "'/models.json'", ";", "$", "resource", ".=", "'?'", ".", "$", "this", "-...
Get models in category Returns models list represented in category of Yandex.Market service according to params. @see https://tech.yandex.ru/market/content-data/doc/dg/reference/category-id-model-docpage/ @param int $categoryId @param array $params @return Models\ResponseCategoryGetModels
[ "Get", "models", "in", "category" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/Clients/CategoryClient.php#L108-L117
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/Clients/CategoryClient.php
CategoryClient.getFilters
public function getFilters($categoryId, $params = array()) { $resource = 'category/' . $categoryId . '/filters.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $getCategoryFiltersResponse = new Models\ResponseCategoryGetFilters($response); return $getCategoryFiltersResponse; }
php
public function getFilters($categoryId, $params = array()) { $resource = 'category/' . $categoryId . '/filters.json'; $resource .= '?' . $this->buildQueryString($params); $response = $this->getServiceResponse($resource); $getCategoryFiltersResponse = new Models\ResponseCategoryGetFilters($response); return $getCategoryFiltersResponse; }
[ "public", "function", "getFilters", "(", "$", "categoryId", ",", "$", "params", "=", "array", "(", ")", ")", "{", "$", "resource", "=", "'category/'", ".", "$", "categoryId", ".", "'/filters.json'", ";", "$", "resource", ".=", "'?'", ".", "$", "this", ...
Get filters in category Returns filters list of models represented in category of Yandex.Market service according to params. @see https://tech.yandex.ru/market/content-data/doc/dg/reference/category-id-filters-docpage/ @param int $categoryId @param array $params @return Models\ResponseCategoryGetFilters
[ "Get", "filters", "in", "category" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/Clients/CategoryClient.php#L131-L140
train
nixsolutions/yandex-php-library
src/Yandex/OAuth/OAuthClient.php
OAuthClient.authRedirect
public function authRedirect($exit = true, $type = self::CODE_AUTH_TYPE, $state = null) { header('Location: ' . $this->getAuthUrl($type, $state)); return $exit ? exit() : true; }
php
public function authRedirect($exit = true, $type = self::CODE_AUTH_TYPE, $state = null) { header('Location: ' . $this->getAuthUrl($type, $state)); return $exit ? exit() : true; }
[ "public", "function", "authRedirect", "(", "$", "exit", "=", "true", ",", "$", "type", "=", "self", "::", "CODE_AUTH_TYPE", ",", "$", "state", "=", "null", ")", "{", "header", "(", "'Location: '", ".", "$", "this", "->", "getAuthUrl", "(", "$", "type",...
Sends a redirect to the Yandex authentication page. @param bool $exit indicates whether to stop the PHP script immediately or not @param string $type a type of the authentication procedure @param string $state optional string @return bool|void
[ "Sends", "a", "redirect", "to", "the", "Yandex", "authentication", "page", "." ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/OAuth/OAuthClient.php#L129-L134
train
nixsolutions/yandex-php-library
src/Yandex/OAuth/OAuthClient.php
OAuthClient.requestAccessToken
public function requestAccessToken($code) { $client = $this->getClient(); try { $response = $client->request( 'POST', '/token', [ 'auth' => [ $this->clientId, $this->clientSecret ], 'form_params' => [ 'grant_type' => 'authorization_code', 'code' => $code, 'client_id' => $this->clientId, 'client_secret' => $this->clientSecret ] ] ); } catch (ClientException $ex) { $result = $this->getDecodedBody($ex->getResponse()->getBody()); if (is_array($result) && isset($result['error'])) { // handle a service error message $message = 'Service responsed with error code "' . $result['error'] . '".'; if (isset($result['error_description']) && $result['error_description']) { $message .= ' Description "' . $result['error_description'] . '".'; } throw new AuthRequestException($message, 0, $ex); } // unknown error. not parsed error throw $ex; } try { $result = $this->getDecodedBody($response->getBody()); } catch (\RuntimeException $ex) { throw new AuthResponseException('Server response can\'t be parsed', 0, $ex); } if (!is_array($result)) { throw new AuthResponseException('Server response has unknown format'); } if (!isset($result['access_token'])) { throw new AuthResponseException('Server response doesn\'t contain access token'); } $this->setAccessToken($result['access_token']); $lifetimeInSeconds = $result['expires_in']; $expireDateTime = new \DateTime(); $expireDateTime->add(new \DateInterval('PT'.$lifetimeInSeconds.'S')); $this->setExpiresIn($expireDateTime); return $this; }
php
public function requestAccessToken($code) { $client = $this->getClient(); try { $response = $client->request( 'POST', '/token', [ 'auth' => [ $this->clientId, $this->clientSecret ], 'form_params' => [ 'grant_type' => 'authorization_code', 'code' => $code, 'client_id' => $this->clientId, 'client_secret' => $this->clientSecret ] ] ); } catch (ClientException $ex) { $result = $this->getDecodedBody($ex->getResponse()->getBody()); if (is_array($result) && isset($result['error'])) { // handle a service error message $message = 'Service responsed with error code "' . $result['error'] . '".'; if (isset($result['error_description']) && $result['error_description']) { $message .= ' Description "' . $result['error_description'] . '".'; } throw new AuthRequestException($message, 0, $ex); } // unknown error. not parsed error throw $ex; } try { $result = $this->getDecodedBody($response->getBody()); } catch (\RuntimeException $ex) { throw new AuthResponseException('Server response can\'t be parsed', 0, $ex); } if (!is_array($result)) { throw new AuthResponseException('Server response has unknown format'); } if (!isset($result['access_token'])) { throw new AuthResponseException('Server response doesn\'t contain access token'); } $this->setAccessToken($result['access_token']); $lifetimeInSeconds = $result['expires_in']; $expireDateTime = new \DateTime(); $expireDateTime->add(new \DateInterval('PT'.$lifetimeInSeconds.'S')); $this->setExpiresIn($expireDateTime); return $this; }
[ "public", "function", "requestAccessToken", "(", "$", "code", ")", "{", "$", "client", "=", "$", "this", "->", "getClient", "(", ")", ";", "try", "{", "$", "response", "=", "$", "client", "->", "request", "(", "'POST'", ",", "'/token'", ",", "[", "'a...
Exchanges a temporary code for an access token. @param $code @throws AuthRequestException on a known request error @throws AuthResponseException on a response format error @throws RequestException on an unknown request error @return self
[ "Exchanges", "a", "temporary", "code", "for", "an", "access", "token", "." ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/OAuth/OAuthClient.php#L147-L209
train
nixsolutions/yandex-php-library
src/Yandex/Metrica/Stat/DataClient.php
DataClient.getDrillDown
public function getDrillDown(Models\TableParams $params, array $parentId = []) { $resource = 'drilldown'; $params = $params->toArray(); if (!empty($parentId)) { $params['parent_id'] = json_encode($parentId); } $response = $this->sendGetRequest($resource, $params); $dataResponse = new Models\DrillDown($response); return $dataResponse; }
php
public function getDrillDown(Models\TableParams $params, array $parentId = []) { $resource = 'drilldown'; $params = $params->toArray(); if (!empty($parentId)) { $params['parent_id'] = json_encode($parentId); } $response = $this->sendGetRequest($resource, $params); $dataResponse = new Models\DrillDown($response); return $dataResponse; }
[ "public", "function", "getDrillDown", "(", "Models", "\\", "TableParams", "$", "params", ",", "array", "$", "parentId", "=", "[", "]", ")", "{", "$", "resource", "=", "'drilldown'", ";", "$", "params", "=", "$", "params", "->", "toArray", "(", ")", ";"...
Get drill down @see http://api.yandex.ru/metrika/doc/beta/api_v1/drilldown.xml @param Models\TableParams $params @param array $parentId @return Models\DrillDown
[ "Get", "drill", "down" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Metrica/Stat/DataClient.php#L44-L56
train
nixsolutions/yandex-php-library
src/Yandex/Metrica/Stat/DataClient.php
DataClient.getByTime
public function getByTime(Models\ByTimeParams $params) { $resource = 'bytime'; $response = $this->sendGetRequest($resource, $params->toArray()); $dataResponse = new Models\ByTimeData($response); return $dataResponse; }
php
public function getByTime(Models\ByTimeParams $params) { $resource = 'bytime'; $response = $this->sendGetRequest($resource, $params->toArray()); $dataResponse = new Models\ByTimeData($response); return $dataResponse; }
[ "public", "function", "getByTime", "(", "Models", "\\", "ByTimeParams", "$", "params", ")", "{", "$", "resource", "=", "'bytime'", ";", "$", "response", "=", "$", "this", "->", "sendGetRequest", "(", "$", "resource", ",", "$", "params", "->", "toArray", ...
Get data by time @see http://api.yandex.ru/metrika/doc/beta/api_v1/bytime.xml @param Models\ByTimeParams $params @return Models\ByTimeData
[ "Get", "data", "by", "time" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Metrica/Stat/DataClient.php#L66-L72
train
nixsolutions/yandex-php-library
src/Yandex/Metrica/Stat/DataClient.php
DataClient.getComparisonDrillDown
public function getComparisonDrillDown(Models\DrillDownComparisonParams $params) { $resource = 'comparison/drilldown'; $response = $this->sendGetRequest($resource, $params->toArray()); $dataResponse = new Models\DrillDownComparison($response); return $dataResponse; }
php
public function getComparisonDrillDown(Models\DrillDownComparisonParams $params) { $resource = 'comparison/drilldown'; $response = $this->sendGetRequest($resource, $params->toArray()); $dataResponse = new Models\DrillDownComparison($response); return $dataResponse; }
[ "public", "function", "getComparisonDrillDown", "(", "Models", "\\", "DrillDownComparisonParams", "$", "params", ")", "{", "$", "resource", "=", "'comparison/drilldown'", ";", "$", "response", "=", "$", "this", "->", "sendGetRequest", "(", "$", "resource", ",", ...
Comparison drill down @see http://api.yandex.ru/metrika/doc/beta/api_v1/comparison_drilldown.xml @param Models\DrillDownComparisonParams $params @return Models\DrillDownComparison
[ "Comparison", "drill", "down" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Metrica/Stat/DataClient.php#L98-L104
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/Models/Comments.php
Comments.add
public function add($comment) { if (is_array($comment)) { $this->collection[] = new Comment($comment); } elseif (is_object($comment) && $comment instanceof Comment) { $this->collection[] = $comment; } return $this; }
php
public function add($comment) { if (is_array($comment)) { $this->collection[] = new Comment($comment); } elseif (is_object($comment) && $comment instanceof Comment) { $this->collection[] = $comment; } return $this; }
[ "public", "function", "add", "(", "$", "comment", ")", "{", "if", "(", "is_array", "(", "$", "comment", ")", ")", "{", "$", "this", "->", "collection", "[", "]", "=", "new", "Comment", "(", "$", "comment", ")", ";", "}", "elseif", "(", "is_object",...
Add comment to collection @param Comment|array $comment @return Comments
[ "Add", "comment", "to", "collection" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/Models/Comments.php#L16-L25
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/Models/Children.php
Children.add
public function add($childModel) { if (is_array($childModel)) { $this->collection[] = new ModelChild($childModel); } elseif (is_object($childModel) && $childModel instanceof ModelChild) { $this->collection[] = $childModel; } return $this; }
php
public function add($childModel) { if (is_array($childModel)) { $this->collection[] = new ModelChild($childModel); } elseif (is_object($childModel) && $childModel instanceof ModelChild) { $this->collection[] = $childModel; } return $this; }
[ "public", "function", "add", "(", "$", "childModel", ")", "{", "if", "(", "is_array", "(", "$", "childModel", ")", ")", "{", "$", "this", "->", "collection", "[", "]", "=", "new", "ModelChild", "(", "$", "childModel", ")", ";", "}", "elseif", "(", ...
Add childModel to collection @param ModelChild|array $childModel @return Children
[ "Add", "childModel", "to", "collection" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/Models/Children.php#L33-L42
train
nixsolutions/yandex-php-library
src/Yandex/Market/Content/Models/Shops.php
Shops.add
public function add($shop) { if (is_array($shop)) { $this->collection[] = new Shop($shop); } elseif (is_object($shop) && $shop instanceof Shop) { $this->collection[] = $shop; } return $this; }
php
public function add($shop) { if (is_array($shop)) { $this->collection[] = new Shop($shop); } elseif (is_object($shop) && $shop instanceof Shop) { $this->collection[] = $shop; } return $this; }
[ "public", "function", "add", "(", "$", "shop", ")", "{", "if", "(", "is_array", "(", "$", "shop", ")", ")", "{", "$", "this", "->", "collection", "[", "]", "=", "new", "Shop", "(", "$", "shop", ")", ";", "}", "elseif", "(", "is_object", "(", "$...
Add shop to collection @param Shop|array $shop @return Shops
[ "Add", "shop", "to", "collection" ]
9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89
https://github.com/nixsolutions/yandex-php-library/blob/9f1d6eee82810cccbdfbb8f3b66f7f6dc1d76c89/src/Yandex/Market/Content/Models/Shops.php#L16-L25
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/Syntax/AddToTable.php
AddToTable.add
public function add($migrationData, array $fields) { if ( ! isset($migrationData['method'])) { $migrationData['method'] = 'table'; } $compiled = $this->compiler->compile($this->getTemplate(), $migrationData); return $this->replaceFieldsWith($this->addColumns($fields), $compiled); }
php
public function add($migrationData, array $fields) { if ( ! isset($migrationData['method'])) { $migrationData['method'] = 'table'; } $compiled = $this->compiler->compile($this->getTemplate(), $migrationData); return $this->replaceFieldsWith($this->addColumns($fields), $compiled); }
[ "public", "function", "add", "(", "$", "migrationData", ",", "array", "$", "fields", ")", "{", "if", "(", "!", "isset", "(", "$", "migrationData", "[", "'method'", "]", ")", ")", "{", "$", "migrationData", "[", "'method'", "]", "=", "'table'", ";", "...
Add syntax for table addition @param $migrationData @param array $fields @return mixed
[ "Add", "syntax", "for", "table", "addition" ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/Syntax/AddToTable.php#L12-L22
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/Syntax/AddToTable.php
AddToTable.addColumns
protected function addColumns($fields) { $schema = []; foreach($fields as $field) { $schema[] = $this->addColumn($field); } return $schema; }
php
protected function addColumns($fields) { $schema = []; foreach($fields as $field) { $schema[] = $this->addColumn($field); } return $schema; }
[ "protected", "function", "addColumns", "(", "$", "fields", ")", "{", "$", "schema", "=", "[", "]", ";", "foreach", "(", "$", "fields", "as", "$", "field", ")", "{", "$", "schema", "[", "]", "=", "$", "this", "->", "addColumn", "(", "$", "field", ...
Return string for adding all columns @param $fields @return array
[ "Return", "string", "for", "adding", "all", "columns" ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/Syntax/AddToTable.php#L30-L40
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/SchemaCreator.php
SchemaCreator.up
public function up(array $migrationData, array $fields = []) { $this->guardAction($migrationData['action']); $method = $migrationData['action'] . 'Factory'; return $this->$method($migrationData, $fields); }
php
public function up(array $migrationData, array $fields = []) { $this->guardAction($migrationData['action']); $method = $migrationData['action'] . 'Factory'; return $this->$method($migrationData, $fields); }
[ "public", "function", "up", "(", "array", "$", "migrationData", ",", "array", "$", "fields", "=", "[", "]", ")", "{", "$", "this", "->", "guardAction", "(", "$", "migrationData", "[", "'action'", "]", ")", ";", "$", "method", "=", "$", "migrationData",...
Build the string for the migration file "up" method @param array $migrationData @param array $fields @throws Exception @return mixed|string
[ "Build", "the", "string", "for", "the", "migration", "file", "up", "method" ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/SchemaCreator.php#L41-L48
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/SchemaCreator.php
SchemaCreator.down
public function down(array $migrationData, $fields = []) { $this->guardAction($migrationData['action']); $opposites = [ 'delete' => 'create', 'create' => 'delete', 'remove' => 'add', 'add' => 'remove' ]; $method = $opposites[$migrationData['action']] . 'Factory'; return $this->$method($migrationData, $fields); }
php
public function down(array $migrationData, $fields = []) { $this->guardAction($migrationData['action']); $opposites = [ 'delete' => 'create', 'create' => 'delete', 'remove' => 'add', 'add' => 'remove' ]; $method = $opposites[$migrationData['action']] . 'Factory'; return $this->$method($migrationData, $fields); }
[ "public", "function", "down", "(", "array", "$", "migrationData", ",", "$", "fields", "=", "[", "]", ")", "{", "$", "this", "->", "guardAction", "(", "$", "migrationData", "[", "'action'", "]", ")", ";", "$", "opposites", "=", "[", "'delete'", "=>", ...
Build the string for the migration file "down" method @param array $migrationData @param array $fields @throws Exception @return array|mixed|string
[ "Build", "the", "string", "for", "the", "migration", "file", "down", "method" ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/SchemaCreator.php#L58-L72
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/Syntax/RemoveFromTable.php
RemoveFromTable.remove
public function remove($migrationData, array $fields) { $migrationData['method'] = 'table'; $compiled = $this->compiler->compile($this->getTemplate(), $migrationData); return $this->replaceFieldsWith($this->dropColumns($fields), $compiled); }
php
public function remove($migrationData, array $fields) { $migrationData['method'] = 'table'; $compiled = $this->compiler->compile($this->getTemplate(), $migrationData); return $this->replaceFieldsWith($this->dropColumns($fields), $compiled); }
[ "public", "function", "remove", "(", "$", "migrationData", ",", "array", "$", "fields", ")", "{", "$", "migrationData", "[", "'method'", "]", "=", "'table'", ";", "$", "compiled", "=", "$", "this", "->", "compiler", "->", "compile", "(", "$", "this", "...
Compile and return string for removing columns @param $migrationData @param array $fields @return mixed
[ "Compile", "and", "return", "string", "for", "removing", "columns" ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/Syntax/RemoveFromTable.php#L12-L19
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/Syntax/RemoveFromTable.php
RemoveFromTable.dropColumns
protected function dropColumns(array $fields) { $schema = []; foreach($fields as $field) { $schema[] = $this->dropColumn($field); } return $schema; }
php
protected function dropColumns(array $fields) { $schema = []; foreach($fields as $field) { $schema[] = $this->dropColumn($field); } return $schema; }
[ "protected", "function", "dropColumns", "(", "array", "$", "fields", ")", "{", "$", "schema", "=", "[", "]", ";", "foreach", "(", "$", "fields", "as", "$", "field", ")", "{", "$", "schema", "[", "]", "=", "$", "this", "->", "dropColumn", "(", "$", ...
Return string for dropping all columns @param array $fields @return array
[ "Return", "string", "for", "dropping", "all", "columns" ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/Syntax/RemoveFromTable.php#L27-L37
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/Commands/PivotGeneratorCommand.php
PivotGeneratorCommand.fire
public function fire() { list($tableOne, $tableTwo) = $this->sortDesiredTables(); $this->call('generate:migration', [ 'migrationName' => "create_{$tableOne}_{$tableTwo}_table", '--fields' => $this->getMigrationFields($tableOne, $tableTwo) ]); }
php
public function fire() { list($tableOne, $tableTwo) = $this->sortDesiredTables(); $this->call('generate:migration', [ 'migrationName' => "create_{$tableOne}_{$tableTwo}_table", '--fields' => $this->getMigrationFields($tableOne, $tableTwo) ]); }
[ "public", "function", "fire", "(", ")", "{", "list", "(", "$", "tableOne", ",", "$", "tableTwo", ")", "=", "$", "this", "->", "sortDesiredTables", "(", ")", ";", "$", "this", "->", "call", "(", "'generate:migration'", ",", "[", "'migrationName'", "=>", ...
Create a pivot table migration
[ "Create", "a", "pivot", "table", "migration" ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/Commands/PivotGeneratorCommand.php#L26-L34
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/templates/Data/Controller.php
Controller.fetch
public function fetch() { return [ 'name' => $this->getName($this->controllerName), 'collection' => $this->getCollection(), 'resource' => $this->getResource(), 'model' => $this->getModel(), 'namespace' => $this->getNamespace() ]; }
php
public function fetch() { return [ 'name' => $this->getName($this->controllerName), 'collection' => $this->getCollection(), 'resource' => $this->getResource(), 'model' => $this->getModel(), 'namespace' => $this->getNamespace() ]; }
[ "public", "function", "fetch", "(", ")", "{", "return", "[", "'name'", "=>", "$", "this", "->", "getName", "(", "$", "this", "->", "controllerName", ")", ",", "'collection'", "=>", "$", "this", "->", "getCollection", "(", ")", ",", "'resource'", "=>", ...
Fetch the template data for the controller. @return array
[ "Fetch", "the", "template", "data", "for", "the", "controller", "." ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/templates/Data/Controller.php#L27-L36
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/GeneratorsServiceProvider.php
GeneratorsServiceProvider.registerModel
protected function registerModel() { $this->app['generate.model'] = $this->app->share(function($app) { $generator = $this->app->make('Way\Generators\Generator'); return new ModelGeneratorCommand($generator); }); $this->commands('generate.model'); }
php
protected function registerModel() { $this->app['generate.model'] = $this->app->share(function($app) { $generator = $this->app->make('Way\Generators\Generator'); return new ModelGeneratorCommand($generator); }); $this->commands('generate.model'); }
[ "protected", "function", "registerModel", "(", ")", "{", "$", "this", "->", "app", "[", "'generate.model'", "]", "=", "$", "this", "->", "app", "->", "share", "(", "function", "(", "$", "app", ")", "{", "$", "generator", "=", "$", "this", "->", "app"...
Register the model generator
[ "Register", "the", "model", "generator" ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/GeneratorsServiceProvider.php#L56-L66
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/GeneratorsServiceProvider.php
GeneratorsServiceProvider.registerView
protected function registerView() { $this->app['generate.view'] = $this->app->share(function($app) { $generator = $this->app->make('Way\Generators\Generator'); return new ViewGeneratorCommand($generator); }); $this->commands('generate.view'); }
php
protected function registerView() { $this->app['generate.view'] = $this->app->share(function($app) { $generator = $this->app->make('Way\Generators\Generator'); return new ViewGeneratorCommand($generator); }); $this->commands('generate.view'); }
[ "protected", "function", "registerView", "(", ")", "{", "$", "this", "->", "app", "[", "'generate.view'", "]", "=", "$", "this", "->", "app", "->", "share", "(", "function", "(", "$", "app", ")", "{", "$", "generator", "=", "$", "this", "->", "app", ...
Register the view generator
[ "Register", "the", "view", "generator" ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/GeneratorsServiceProvider.php#L71-L81
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/GeneratorsServiceProvider.php
GeneratorsServiceProvider.registerController
protected function registerController() { $this->app['generate.controller'] = $this->app->share(function($app) { $generator = $this->app->make('Way\Generators\Generator'); return new ControllerGeneratorCommand($generator); }); $this->commands('generate.controller'); }
php
protected function registerController() { $this->app['generate.controller'] = $this->app->share(function($app) { $generator = $this->app->make('Way\Generators\Generator'); return new ControllerGeneratorCommand($generator); }); $this->commands('generate.controller'); }
[ "protected", "function", "registerController", "(", ")", "{", "$", "this", "->", "app", "[", "'generate.controller'", "]", "=", "$", "this", "->", "app", "->", "share", "(", "function", "(", "$", "app", ")", "{", "$", "generator", "=", "$", "this", "->...
Register the controller generator
[ "Register", "the", "controller", "generator" ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/GeneratorsServiceProvider.php#L86-L96
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/GeneratorsServiceProvider.php
GeneratorsServiceProvider.registerMigration
protected function registerMigration() { $this->app['generate.migration'] = $this->app->share(function($app) { return $this->app->make('Way\Generators\Commands\MigrationGeneratorCommand'); }); $this->commands('generate.migration'); }
php
protected function registerMigration() { $this->app['generate.migration'] = $this->app->share(function($app) { return $this->app->make('Way\Generators\Commands\MigrationGeneratorCommand'); }); $this->commands('generate.migration'); }
[ "protected", "function", "registerMigration", "(", ")", "{", "$", "this", "->", "app", "[", "'generate.migration'", "]", "=", "$", "this", "->", "app", "->", "share", "(", "function", "(", "$", "app", ")", "{", "return", "$", "this", "->", "app", "->",...
Register the migration generator
[ "Register", "the", "migration", "generator" ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/GeneratorsServiceProvider.php#L101-L109
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/GeneratorsServiceProvider.php
GeneratorsServiceProvider.registerSeeder
protected function registerSeeder() { $this->app['generate.seeder'] = $this->app->share(function($app) { $generator = $this->app->make('Way\Generators\Generator'); return new SeederGeneratorCommand($generator); }); $this->commands('generate.seeder'); }
php
protected function registerSeeder() { $this->app['generate.seeder'] = $this->app->share(function($app) { $generator = $this->app->make('Way\Generators\Generator'); return new SeederGeneratorCommand($generator); }); $this->commands('generate.seeder'); }
[ "protected", "function", "registerSeeder", "(", ")", "{", "$", "this", "->", "app", "[", "'generate.seeder'", "]", "=", "$", "this", "->", "app", "->", "share", "(", "function", "(", "$", "app", ")", "{", "$", "generator", "=", "$", "this", "->", "ap...
Register the seeder generator
[ "Register", "the", "seeder", "generator" ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/GeneratorsServiceProvider.php#L114-L124
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/GeneratorsServiceProvider.php
GeneratorsServiceProvider.registerPivot
protected function registerPivot() { $this->app['generate.pivot'] = $this->app->share(function($app) { return new PivotGeneratorCommand; }); $this->commands('generate.pivot'); }
php
protected function registerPivot() { $this->app['generate.pivot'] = $this->app->share(function($app) { return new PivotGeneratorCommand; }); $this->commands('generate.pivot'); }
[ "protected", "function", "registerPivot", "(", ")", "{", "$", "this", "->", "app", "[", "'generate.pivot'", "]", "=", "$", "this", "->", "app", "->", "share", "(", "function", "(", "$", "app", ")", "{", "return", "new", "PivotGeneratorCommand", ";", "}",...
Register the pivot generator
[ "Register", "the", "pivot", "generator" ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/GeneratorsServiceProvider.php#L129-L137
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/GeneratorsServiceProvider.php
GeneratorsServiceProvider.registerResource
protected function registerResource() { $this->app['generate.resource'] = $this->app->share(function($app) { $generator = $this->app->make('Way\Generators\Generator'); return new ResourceGeneratorCommand($generator); }); $this->commands('generate.resource'); }
php
protected function registerResource() { $this->app['generate.resource'] = $this->app->share(function($app) { $generator = $this->app->make('Way\Generators\Generator'); return new ResourceGeneratorCommand($generator); }); $this->commands('generate.resource'); }
[ "protected", "function", "registerResource", "(", ")", "{", "$", "this", "->", "app", "[", "'generate.resource'", "]", "=", "$", "this", "->", "app", "->", "share", "(", "function", "(", "$", "app", ")", "{", "$", "generator", "=", "$", "this", "->", ...
Register the resource generator
[ "Register", "the", "resource", "generator" ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/GeneratorsServiceProvider.php#L142-L152
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/GeneratorsServiceProvider.php
GeneratorsServiceProvider.registerpublisher
public function registerpublisher() { $this->app['generate.publish-templates'] = $this->app->share(function($app) { return new publishtemplatescommand; }); $this->commands('generate.publish-templates'); }
php
public function registerpublisher() { $this->app['generate.publish-templates'] = $this->app->share(function($app) { return new publishtemplatescommand; }); $this->commands('generate.publish-templates'); }
[ "public", "function", "registerpublisher", "(", ")", "{", "$", "this", "->", "app", "[", "'generate.publish-templates'", "]", "=", "$", "this", "->", "app", "->", "share", "(", "function", "(", "$", "app", ")", "{", "return", "new", "publishtemplatescommand"...
register command for publish templates
[ "register", "command", "for", "publish", "templates" ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/GeneratorsServiceProvider.php#L157-L165
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/GeneratorsServiceProvider.php
GeneratorsServiceProvider.registerScaffold
public function registerScaffold() { $this->app['generate.scaffold'] = $this->app->share(function($app) { return new ScaffoldGeneratorCommand; }); $this->commands('generate.scaffold'); }
php
public function registerScaffold() { $this->app['generate.scaffold'] = $this->app->share(function($app) { return new ScaffoldGeneratorCommand; }); $this->commands('generate.scaffold'); }
[ "public", "function", "registerScaffold", "(", ")", "{", "$", "this", "->", "app", "[", "'generate.scaffold'", "]", "=", "$", "this", "->", "app", "->", "share", "(", "function", "(", "$", "app", ")", "{", "return", "new", "ScaffoldGeneratorCommand", ";", ...
register scaffold command
[ "register", "scaffold", "command" ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/GeneratorsServiceProvider.php#L170-L178
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/templates/Data/Migration.php
Migration.fetch
public function fetch() { $parsedName = $this->getParsedMigrationName(); $parsedFields = $this->getParsedMigrationFields(); return [ 'class' => $this->getClass(), 'up' => $this->getMigrationUp($parsedName, $parsedFields), 'down' => $this->getMigrationDown($parsedName, $parsedFields) ]; }
php
public function fetch() { $parsedName = $this->getParsedMigrationName(); $parsedFields = $this->getParsedMigrationFields(); return [ 'class' => $this->getClass(), 'up' => $this->getMigrationUp($parsedName, $parsedFields), 'down' => $this->getMigrationDown($parsedName, $parsedFields) ]; }
[ "public", "function", "fetch", "(", ")", "{", "$", "parsedName", "=", "$", "this", "->", "getParsedMigrationName", "(", ")", ";", "$", "parsedFields", "=", "$", "this", "->", "getParsedMigrationFields", "(", ")", ";", "return", "[", "'class'", "=>", "$", ...
Fetch the template data for a migration generation. @return array
[ "Fetch", "the", "template", "data", "for", "a", "migration", "generation", "." ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/templates/Data/Migration.php#L40-L50
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/Parsers/MigrationNameParser.php
MigrationNameParser.getTableName
protected function getTableName(array $pieces) { $tableName = []; // This is deceptively complex, because // there are a number of ways to write // these migration names. We'll work backwards // to figure out the name. foreach(array_reverse($pieces) as $piece) { // Once we get to a connecting word (if any), this // will signal the end of our search. So, for // add_name_to_archived_lessons, "archived_lessons" // would be the table name if (in_array($piece, ['to', 'for', 'on', 'from', 'into'])) break; $tableName[] = $piece; } // We can't forget to reverse it back again! return implode('_', array_reverse($tableName)); }
php
protected function getTableName(array $pieces) { $tableName = []; // This is deceptively complex, because // there are a number of ways to write // these migration names. We'll work backwards // to figure out the name. foreach(array_reverse($pieces) as $piece) { // Once we get to a connecting word (if any), this // will signal the end of our search. So, for // add_name_to_archived_lessons, "archived_lessons" // would be the table name if (in_array($piece, ['to', 'for', 'on', 'from', 'into'])) break; $tableName[] = $piece; } // We can't forget to reverse it back again! return implode('_', array_reverse($tableName)); }
[ "protected", "function", "getTableName", "(", "array", "$", "pieces", ")", "{", "$", "tableName", "=", "[", "]", ";", "// This is deceptively complex, because", "// there are a number of ways to write", "// these migration names. We'll work backwards", "// to figure out the name....
Determine what the table name should be @param array $pieces @return string
[ "Determine", "what", "the", "table", "name", "should", "be" ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/Parsers/MigrationNameParser.php#L40-L61
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/Generator.php
Generator.make
public function make($templatePath, $templateData, $filePathToGenerate) { // We first need to compile the template, // according to the data that we provide. $template = $this->compile($templatePath, $templateData, new TemplateCompiler); // Now that we have the compiled template, // we can actually generate the file. $this->file->make($filePathToGenerate, $template); }
php
public function make($templatePath, $templateData, $filePathToGenerate) { // We first need to compile the template, // according to the data that we provide. $template = $this->compile($templatePath, $templateData, new TemplateCompiler); // Now that we have the compiled template, // we can actually generate the file. $this->file->make($filePathToGenerate, $template); }
[ "public", "function", "make", "(", "$", "templatePath", ",", "$", "templateData", ",", "$", "filePathToGenerate", ")", "{", "// We first need to compile the template,", "// according to the data that we provide.", "$", "template", "=", "$", "this", "->", "compile", "(",...
Run the generator @param $templatePath @param $templateData @param $filePathToGenerate
[ "Run", "the", "generator" ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/Generator.php#L29-L38
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/Generator.php
Generator.compile
public function compile($templatePath, array $data, TemplateCompiler $compiler) { return $compiler->compile($this->file->get($templatePath), $data); }
php
public function compile($templatePath, array $data, TemplateCompiler $compiler) { return $compiler->compile($this->file->get($templatePath), $data); }
[ "public", "function", "compile", "(", "$", "templatePath", ",", "array", "$", "data", ",", "TemplateCompiler", "$", "compiler", ")", "{", "return", "$", "compiler", "->", "compile", "(", "$", "this", "->", "file", "->", "get", "(", "$", "templatePath", "...
Compile the file @param $templatePath @param array $data @param TemplateCompiler $compiler @throws UndefinedTemplate @return mixed
[ "Compile", "the", "file" ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/Generator.php#L49-L52
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/Commands/ViewGeneratorCommand.php
ViewGeneratorCommand.fire
public function fire() { $directoryPath = dirname($this->getFileGenerationPath()); if ( ! File::exists($directoryPath)) { File::makeDirectory($directoryPath, 0777, true); } parent::fire(); }
php
public function fire() { $directoryPath = dirname($this->getFileGenerationPath()); if ( ! File::exists($directoryPath)) { File::makeDirectory($directoryPath, 0777, true); } parent::fire(); }
[ "public", "function", "fire", "(", ")", "{", "$", "directoryPath", "=", "dirname", "(", "$", "this", "->", "getFileGenerationPath", "(", ")", ")", ";", "if", "(", "!", "File", "::", "exists", "(", "$", "directoryPath", ")", ")", "{", "File", "::", "m...
Create directory tree for views, and fire the generator.
[ "Create", "directory", "tree", "for", "views", "and", "fire", "the", "generator", "." ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/Commands/ViewGeneratorCommand.php#L26-L36
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/Commands/GeneratorCommand.php
GeneratorCommand.fire
public function fire() { $filePathToGenerate = $this->getFileGenerationPath(); try { $this->generator->make( $this->getTemplatePath(), $this->getTemplateData(), $filePathToGenerate ); $this->info("Created: {$filePathToGenerate}"); } catch (FileAlreadyExists $e) { $this->error("The file, {$filePathToGenerate}, already exists! I don't want to overwrite it."); } }
php
public function fire() { $filePathToGenerate = $this->getFileGenerationPath(); try { $this->generator->make( $this->getTemplatePath(), $this->getTemplateData(), $filePathToGenerate ); $this->info("Created: {$filePathToGenerate}"); } catch (FileAlreadyExists $e) { $this->error("The file, {$filePathToGenerate}, already exists! I don't want to overwrite it."); } }
[ "public", "function", "fire", "(", ")", "{", "$", "filePathToGenerate", "=", "$", "this", "->", "getFileGenerationPath", "(", ")", ";", "try", "{", "$", "this", "->", "generator", "->", "make", "(", "$", "this", "->", "getTemplatePath", "(", ")", ",", ...
Compile and generate the file.
[ "Compile", "and", "generate", "the", "file", "." ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/Commands/GeneratorCommand.php#L55-L74
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/Commands/GeneratorCommand.php
GeneratorCommand.getPathByOptionOrConfig
protected function getPathByOptionOrConfig($option, $configName) { if ($path = $this->option($option)) return $path; return Config::get("generators::config.{$configName}"); }
php
protected function getPathByOptionOrConfig($option, $configName) { if ($path = $this->option($option)) return $path; return Config::get("generators::config.{$configName}"); }
[ "protected", "function", "getPathByOptionOrConfig", "(", "$", "option", ",", "$", "configName", ")", "{", "if", "(", "$", "path", "=", "$", "this", "->", "option", "(", "$", "option", ")", ")", "return", "$", "path", ";", "return", "Config", "::", "get...
Get a directory path through a command option, or from the configuration. @param $option @param $configName @return string
[ "Get", "a", "directory", "path", "through", "a", "command", "option", "or", "from", "the", "configuration", "." ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/Commands/GeneratorCommand.php#L83-L88
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/Commands/ResourceGeneratorCommand.php
ResourceGeneratorCommand.fire
public function fire() { $resource = $this->argument('resource'); $this->callModel($resource); $this->callView($resource); $this->callController($resource); $this->callMigration($resource); $this->callSeeder($resource); $this->callMigrate(); // All done! $this->info(sprintf( "All done! Don't forget to add `%s` to %s." . PHP_EOL, "Route::resource('{$this->getTableName($resource)}', '{$this->getControllerName($resource)}');", "app/routes.php" )); }
php
public function fire() { $resource = $this->argument('resource'); $this->callModel($resource); $this->callView($resource); $this->callController($resource); $this->callMigration($resource); $this->callSeeder($resource); $this->callMigrate(); // All done! $this->info(sprintf( "All done! Don't forget to add `%s` to %s." . PHP_EOL, "Route::resource('{$this->getTableName($resource)}', '{$this->getControllerName($resource)}');", "app/routes.php" )); }
[ "public", "function", "fire", "(", ")", "{", "$", "resource", "=", "$", "this", "->", "argument", "(", "'resource'", ")", ";", "$", "this", "->", "callModel", "(", "$", "resource", ")", ";", "$", "this", "->", "callView", "(", "$", "resource", ")", ...
Generate a resource @return mixed
[ "Generate", "a", "resource" ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/Commands/ResourceGeneratorCommand.php#L28-L46
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/Commands/ResourceGeneratorCommand.php
ResourceGeneratorCommand.callView
protected function callView($resource) { $collection = $this->getTableName($resource); $modelName = $this->getModelName($resource); if ($this->confirm("Do you want me to create views for this $modelName resource? [yes|no]")) { foreach(['index', 'show', 'create', 'edit'] as $viewName) { $viewName = "{$collection}.{$viewName}"; $this->call('generate:view', compact('viewName')); } } }
php
protected function callView($resource) { $collection = $this->getTableName($resource); $modelName = $this->getModelName($resource); if ($this->confirm("Do you want me to create views for this $modelName resource? [yes|no]")) { foreach(['index', 'show', 'create', 'edit'] as $viewName) { $viewName = "{$collection}.{$viewName}"; $this->call('generate:view', compact('viewName')); } } }
[ "protected", "function", "callView", "(", "$", "resource", ")", "{", "$", "collection", "=", "$", "this", "->", "getTableName", "(", "$", "resource", ")", ";", "$", "modelName", "=", "$", "this", "->", "getModelName", "(", "$", "resource", ")", ";", "i...
Call view generator if user confirms @param $resource
[ "Call", "view", "generator", "if", "user", "confirms" ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/Commands/ResourceGeneratorCommand.php#L112-L126
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/Commands/ResourceGeneratorCommand.php
ResourceGeneratorCommand.callMigration
protected function callMigration($resource) { $migrationName = $this->getMigrationName($resource); if ($this->confirm("Do you want me to create a '$migrationName' migration and schema for this resource? [yes|no]")) { $this->call('generate:migration', [ 'migrationName' => $migrationName, '--fields' => $this->option('fields') ]); } }
php
protected function callMigration($resource) { $migrationName = $this->getMigrationName($resource); if ($this->confirm("Do you want me to create a '$migrationName' migration and schema for this resource? [yes|no]")) { $this->call('generate:migration', [ 'migrationName' => $migrationName, '--fields' => $this->option('fields') ]); } }
[ "protected", "function", "callMigration", "(", "$", "resource", ")", "{", "$", "migrationName", "=", "$", "this", "->", "getMigrationName", "(", "$", "resource", ")", ";", "if", "(", "$", "this", "->", "confirm", "(", "\"Do you want me to create a '$migrationNam...
Call migration generator if user confirms @param $resource
[ "Call", "migration", "generator", "if", "user", "confirms" ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/Commands/ResourceGeneratorCommand.php#L148-L159
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/Commands/ResourceGeneratorCommand.php
ResourceGeneratorCommand.callSeeder
protected function callSeeder($resource) { $tableName = str_plural($this->getModelName($resource)); if ($this->confirm("Would you like a '$tableName' table seeder? [yes|no]")) { $this->call('generate:seed', compact('tableName')); } }
php
protected function callSeeder($resource) { $tableName = str_plural($this->getModelName($resource)); if ($this->confirm("Would you like a '$tableName' table seeder? [yes|no]")) { $this->call('generate:seed', compact('tableName')); } }
[ "protected", "function", "callSeeder", "(", "$", "resource", ")", "{", "$", "tableName", "=", "str_plural", "(", "$", "this", "->", "getModelName", "(", "$", "resource", ")", ")", ";", "if", "(", "$", "this", "->", "confirm", "(", "\"Would you like a '$tab...
Call seeder generator if user confirms @param $resource
[ "Call", "seeder", "generator", "if", "user", "confirms" ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/Commands/ResourceGeneratorCommand.php#L166-L174
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/Commands/PublishTemplatesCommand.php
PublishTemplatesCommand.pointConfigFileTemplatesToNewLocation
protected function pointConfigFileTemplatesToNewLocation() { $configPath = app_path('config/packages/way/generators/config.php'); $updated = str_replace('vendor/way/generators/src/Way/Generators/templates', $this->option('path'), File::get($configPath)); File::put($configPath, $updated); }
php
protected function pointConfigFileTemplatesToNewLocation() { $configPath = app_path('config/packages/way/generators/config.php'); $updated = str_replace('vendor/way/generators/src/Way/Generators/templates', $this->option('path'), File::get($configPath)); File::put($configPath, $updated); }
[ "protected", "function", "pointConfigFileTemplatesToNewLocation", "(", ")", "{", "$", "configPath", "=", "app_path", "(", "'config/packages/way/generators/config.php'", ")", ";", "$", "updated", "=", "str_replace", "(", "'vendor/way/generators/src/Way/Generators/templates'", ...
Update config file to point to the new templates directory
[ "Update", "config", "file", "to", "point", "to", "the", "new", "templates", "directory" ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/Commands/PublishTemplatesCommand.php#L61-L67
train
JeffreyWay/Laravel-4-Generators
src/Way/Generators/Syntax/CreateTable.php
CreateTable.create
public function create($migrationData, $fields) { $migrationData = ['method' => 'create', 'table' => $migrationData['table']]; // All new tables should have an identifier // Let's add that for the user automatically array_unshift($fields, ['field' => 'id', 'type' => 'increments']); // We'll also add timestamps to new tables for convenience array_push($fields, ['field' => '', 'type' => 'timestamps']); return (new AddToTable($this->file, $this->compiler))->add($migrationData, $fields); }
php
public function create($migrationData, $fields) { $migrationData = ['method' => 'create', 'table' => $migrationData['table']]; // All new tables should have an identifier // Let's add that for the user automatically array_unshift($fields, ['field' => 'id', 'type' => 'increments']); // We'll also add timestamps to new tables for convenience array_push($fields, ['field' => '', 'type' => 'timestamps']); return (new AddToTable($this->file, $this->compiler))->add($migrationData, $fields); }
[ "public", "function", "create", "(", "$", "migrationData", ",", "$", "fields", ")", "{", "$", "migrationData", "=", "[", "'method'", "=>", "'create'", ",", "'table'", "=>", "$", "migrationData", "[", "'table'", "]", "]", ";", "// All new tables should have an ...
Build string for creating a table and columns @param $migrationData @param $fields @return mixed
[ "Build", "string", "for", "creating", "a", "table", "and", "columns" ]
35f369aac77197abf8d1a4cdc494e548aac3cfef
https://github.com/JeffreyWay/Laravel-4-Generators/blob/35f369aac77197abf8d1a4cdc494e548aac3cfef/src/Way/Generators/Syntax/CreateTable.php#L13-L25
train
atayahmet/laravel-nestable
src/NestableTrait.php
NestableTrait.nested
public static function nested($to = 1) { static::$to = $to; static::$nested = is_numeric($to) ? $to : false; return new self(); }
php
public static function nested($to = 1) { static::$to = $to; static::$nested = is_numeric($to) ? $to : false; return new self(); }
[ "public", "static", "function", "nested", "(", "$", "to", "=", "1", ")", "{", "static", "::", "$", "to", "=", "$", "to", ";", "static", "::", "$", "nested", "=", "is_numeric", "(", "$", "to", ")", "?", "$", "to", ":", "false", ";", "return", "n...
Set the nest type. @param int $to @return object
[ "Set", "the", "nest", "type", "." ]
c4997757c0234d705ca079939acd50453741cf42
https://github.com/atayahmet/laravel-nestable/blob/c4997757c0234d705ca079939acd50453741cf42/src/NestableTrait.php#L82-L88
train
atayahmet/laravel-nestable
src/NestableTrait.php
NestableTrait.get
public function get() { // if exists the where or similar things in the query // call the from instance if (static::$_instance instanceof Builder) { $this->source = static::$_instance->get(); } else { // if not call the parent directly $this->source = parent::all(); } if (!static::$nested) { return $this->source; } return $this->to(static::$to); }
php
public function get() { // if exists the where or similar things in the query // call the from instance if (static::$_instance instanceof Builder) { $this->source = static::$_instance->get(); } else { // if not call the parent directly $this->source = parent::all(); } if (!static::$nested) { return $this->source; } return $this->to(static::$to); }
[ "public", "function", "get", "(", ")", "{", "// if exists the where or similar things in the query", "// call the from instance", "if", "(", "static", "::", "$", "_instance", "instanceof", "Builder", ")", "{", "$", "this", "->", "source", "=", "static", "::", "$", ...
Get the data from db to collection or default return. @return mixed
[ "Get", "the", "data", "from", "db", "to", "collection", "or", "default", "return", "." ]
c4997757c0234d705ca079939acd50453741cf42
https://github.com/atayahmet/laravel-nestable/blob/c4997757c0234d705ca079939acd50453741cf42/src/NestableTrait.php#L95-L112
train