repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
grpc/grpc-php | src/lib/BaseStub.php | BaseStub._GrpcStreamStream | private function _GrpcStreamStream($channel)
{
return function ($method,
$deserialize,
array $metadata = [],
array $options = []) use ($channel) {
$call = $this->call_invoker->BidiStreamingCall(
$channel,
... | php | private function _GrpcStreamStream($channel)
{
return function ($method,
$deserialize,
array $metadata = [],
array $options = []) use ($channel) {
$call = $this->call_invoker->BidiStreamingCall(
$channel,
... | [
"private",
"function",
"_GrpcStreamStream",
"(",
"$",
"channel",
")",
"{",
"return",
"function",
"(",
"$",
"method",
",",
"$",
"deserialize",
",",
"array",
"$",
"metadata",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"use",
"(",
... | Create a function which can be used to create BidiStreamingCall
@param Channel|InterceptorChannel $channel
@param callable $deserialize A function that deserializes the response
@return \Closure | [
"Create",
"a",
"function",
"which",
"can",
"be",
"used",
"to",
"create",
"BidiStreamingCall"
] | train | https://github.com/grpc/grpc-php/blob/0f1ffdde45bfb9257c5d9eab81695d0f042bea22/src/lib/BaseStub.php#L361-L388 |
grpc/grpc-php | src/lib/BaseStub.php | BaseStub._UnaryUnaryCallFactory | private function _UnaryUnaryCallFactory($channel)
{
if (is_a($channel, 'Grpc\Internal\InterceptorChannel')) {
return function ($method,
$argument,
$deserialize,
array $metadata = [],
... | php | private function _UnaryUnaryCallFactory($channel)
{
if (is_a($channel, 'Grpc\Internal\InterceptorChannel')) {
return function ($method,
$argument,
$deserialize,
array $metadata = [],
... | [
"private",
"function",
"_UnaryUnaryCallFactory",
"(",
"$",
"channel",
")",
"{",
"if",
"(",
"is_a",
"(",
"$",
"channel",
",",
"'Grpc\\Internal\\InterceptorChannel'",
")",
")",
"{",
"return",
"function",
"(",
"$",
"method",
",",
"$",
"argument",
",",
"$",
"des... | Create a function which can be used to create UnaryCall
@param Channel|InterceptorChannel $channel
@param callable $deserialize A function that deserializes the response
@return \Closure | [
"Create",
"a",
"function",
"which",
"can",
"be",
"used",
"to",
"create",
"UnaryCall"
] | train | https://github.com/grpc/grpc-php/blob/0f1ffdde45bfb9257c5d9eab81695d0f042bea22/src/lib/BaseStub.php#L398-L417 |
grpc/grpc-php | src/lib/BaseStub.php | BaseStub._UnaryStreamCallFactory | private function _UnaryStreamCallFactory($channel)
{
if (is_a($channel, 'Grpc\Internal\InterceptorChannel')) {
return function ($method,
$argument,
$deserialize,
array $metadata = [],
... | php | private function _UnaryStreamCallFactory($channel)
{
if (is_a($channel, 'Grpc\Internal\InterceptorChannel')) {
return function ($method,
$argument,
$deserialize,
array $metadata = [],
... | [
"private",
"function",
"_UnaryStreamCallFactory",
"(",
"$",
"channel",
")",
"{",
"if",
"(",
"is_a",
"(",
"$",
"channel",
",",
"'Grpc\\Internal\\InterceptorChannel'",
")",
")",
"{",
"return",
"function",
"(",
"$",
"method",
",",
"$",
"argument",
",",
"$",
"de... | Create a function which can be used to create ServerStreamingCall
@param Channel|InterceptorChannel $channel
@param callable $deserialize A function that deserializes the response
@return \Closure | [
"Create",
"a",
"function",
"which",
"can",
"be",
"used",
"to",
"create",
"ServerStreamingCall"
] | train | https://github.com/grpc/grpc-php/blob/0f1ffdde45bfb9257c5d9eab81695d0f042bea22/src/lib/BaseStub.php#L427-L446 |
grpc/grpc-php | src/lib/BaseStub.php | BaseStub._StreamUnaryCallFactory | private function _StreamUnaryCallFactory($channel)
{
if (is_a($channel, 'Grpc\Internal\InterceptorChannel')) {
return function ($method,
$deserialize,
array $metadata = [],
array $options = []) use ($channel) ... | php | private function _StreamUnaryCallFactory($channel)
{
if (is_a($channel, 'Grpc\Internal\InterceptorChannel')) {
return function ($method,
$deserialize,
array $metadata = [],
array $options = []) use ($channel) ... | [
"private",
"function",
"_StreamUnaryCallFactory",
"(",
"$",
"channel",
")",
"{",
"if",
"(",
"is_a",
"(",
"$",
"channel",
",",
"'Grpc\\Internal\\InterceptorChannel'",
")",
")",
"{",
"return",
"function",
"(",
"$",
"method",
",",
"$",
"deserialize",
",",
"array"... | Create a function which can be used to create ClientStreamingCall
@param Channel|InterceptorChannel $channel
@param callable $deserialize A function that deserializes the response
@return \Closure | [
"Create",
"a",
"function",
"which",
"can",
"be",
"used",
"to",
"create",
"ClientStreamingCall"
] | train | https://github.com/grpc/grpc-php/blob/0f1ffdde45bfb9257c5d9eab81695d0f042bea22/src/lib/BaseStub.php#L456-L473 |
grpc/grpc-php | src/lib/BaseStub.php | BaseStub._StreamStreamCallFactory | private function _StreamStreamCallFactory($channel)
{
if (is_a($channel, 'Grpc\Internal\InterceptorChannel')) {
return function ($method,
$deserialize,
array $metadata = [],
array $options = []) use ($channel)... | php | private function _StreamStreamCallFactory($channel)
{
if (is_a($channel, 'Grpc\Internal\InterceptorChannel')) {
return function ($method,
$deserialize,
array $metadata = [],
array $options = []) use ($channel)... | [
"private",
"function",
"_StreamStreamCallFactory",
"(",
"$",
"channel",
")",
"{",
"if",
"(",
"is_a",
"(",
"$",
"channel",
",",
"'Grpc\\Internal\\InterceptorChannel'",
")",
")",
"{",
"return",
"function",
"(",
"$",
"method",
",",
"$",
"deserialize",
",",
"array... | Create a function which can be used to create BidiStreamingCall
@param Channel|InterceptorChannel $channel
@param callable $deserialize A function that deserializes the response
@return \Closure | [
"Create",
"a",
"function",
"which",
"can",
"be",
"used",
"to",
"create",
"BidiStreamingCall"
] | train | https://github.com/grpc/grpc-php/blob/0f1ffdde45bfb9257c5d9eab81695d0f042bea22/src/lib/BaseStub.php#L483-L500 |
grpc/grpc-php | src/lib/BaseStub.php | BaseStub._simpleRequest | protected function _simpleRequest(
$method,
$argument,
$deserialize,
array $metadata = [],
array $options = []
) {
$call_factory = $this->_UnaryUnaryCallFactory($this->channel);
$call = $call_factory($method, $argument, $deserialize, $metadata, $options);
... | php | protected function _simpleRequest(
$method,
$argument,
$deserialize,
array $metadata = [],
array $options = []
) {
$call_factory = $this->_UnaryUnaryCallFactory($this->channel);
$call = $call_factory($method, $argument, $deserialize, $metadata, $options);
... | [
"protected",
"function",
"_simpleRequest",
"(",
"$",
"method",
",",
"$",
"argument",
",",
"$",
"deserialize",
",",
"array",
"$",
"metadata",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"call_factory",
"=",
"$",
"this",
... | Call a remote method that takes a single argument and has a
single output.
@param string $method The name of the method to call
@param mixed $argument The argument to the method
@param callable $deserialize A function that deserializes the response
@param array $metadata A metadata map to send to th... | [
"Call",
"a",
"remote",
"method",
"that",
"takes",
"a",
"single",
"argument",
"and",
"has",
"a",
"single",
"output",
"."
] | train | https://github.com/grpc/grpc-php/blob/0f1ffdde45bfb9257c5d9eab81695d0f042bea22/src/lib/BaseStub.php#L517-L527 |
grpc/grpc-php | src/lib/BaseStub.php | BaseStub._clientStreamRequest | protected function _clientStreamRequest(
$method,
$deserialize,
array $metadata = [],
array $options = []
) {
$call_factory = $this->_StreamUnaryCallFactory($this->channel);
$call = $call_factory($method, $deserialize, $metadata, $options);
return $call;
} | php | protected function _clientStreamRequest(
$method,
$deserialize,
array $metadata = [],
array $options = []
) {
$call_factory = $this->_StreamUnaryCallFactory($this->channel);
$call = $call_factory($method, $deserialize, $metadata, $options);
return $call;
} | [
"protected",
"function",
"_clientStreamRequest",
"(",
"$",
"method",
",",
"$",
"deserialize",
",",
"array",
"$",
"metadata",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"call_factory",
"=",
"$",
"this",
"->",
"_StreamUnaryC... | Call a remote method that takes a stream of arguments and has a single
output.
@param string $method The name of the method to call
@param callable $deserialize A function that deserializes the response
@param array $metadata A metadata map to send to the server
(optional)
@param array $options An ... | [
"Call",
"a",
"remote",
"method",
"that",
"takes",
"a",
"stream",
"of",
"arguments",
"and",
"has",
"a",
"single",
"output",
"."
] | train | https://github.com/grpc/grpc-php/blob/0f1ffdde45bfb9257c5d9eab81695d0f042bea22/src/lib/BaseStub.php#L541-L550 |
grpc/grpc-php | src/lib/BaseStub.php | BaseStub._serverStreamRequest | protected function _serverStreamRequest(
$method,
$argument,
$deserialize,
array $metadata = [],
array $options = []
) {
$call_factory = $this->_UnaryStreamCallFactory($this->channel);
$call = $call_factory($method, $argument, $deserialize, $metadata, $options... | php | protected function _serverStreamRequest(
$method,
$argument,
$deserialize,
array $metadata = [],
array $options = []
) {
$call_factory = $this->_UnaryStreamCallFactory($this->channel);
$call = $call_factory($method, $argument, $deserialize, $metadata, $options... | [
"protected",
"function",
"_serverStreamRequest",
"(",
"$",
"method",
",",
"$",
"argument",
",",
"$",
"deserialize",
",",
"array",
"$",
"metadata",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"call_factory",
"=",
"$",
"thi... | Call a remote method that takes a single argument and returns a stream
of responses.
@param string $method The name of the method to call
@param mixed $argument The argument to the method
@param callable $deserialize A function that deserializes the responses
@param array $metadata A metadata map to... | [
"Call",
"a",
"remote",
"method",
"that",
"takes",
"a",
"single",
"argument",
"and",
"returns",
"a",
"stream",
"of",
"responses",
"."
] | train | https://github.com/grpc/grpc-php/blob/0f1ffdde45bfb9257c5d9eab81695d0f042bea22/src/lib/BaseStub.php#L565-L575 |
grpc/grpc-php | src/lib/BaseStub.php | BaseStub._bidiRequest | protected function _bidiRequest(
$method,
$deserialize,
array $metadata = [],
array $options = []
) {
$call_factory = $this->_StreamStreamCallFactory($this->channel);
$call = $call_factory($method, $deserialize, $metadata, $options);
return $call;
} | php | protected function _bidiRequest(
$method,
$deserialize,
array $metadata = [],
array $options = []
) {
$call_factory = $this->_StreamStreamCallFactory($this->channel);
$call = $call_factory($method, $deserialize, $metadata, $options);
return $call;
} | [
"protected",
"function",
"_bidiRequest",
"(",
"$",
"method",
",",
"$",
"deserialize",
",",
"array",
"$",
"metadata",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"call_factory",
"=",
"$",
"this",
"->",
"_StreamStreamCallFact... | Call a remote method with messages streaming in both directions.
@param string $method The name of the method to call
@param callable $deserialize A function that deserializes the responses
@param array $metadata A metadata map to send to the server
(optional)
@param array $options An array of opti... | [
"Call",
"a",
"remote",
"method",
"with",
"messages",
"streaming",
"in",
"both",
"directions",
"."
] | train | https://github.com/grpc/grpc-php/blob/0f1ffdde45bfb9257c5d9eab81695d0f042bea22/src/lib/BaseStub.php#L588-L597 |
grpc/grpc-php | src/lib/ClientStreamingCall.php | ClientStreamingCall.write | public function write($data, array $options = [])
{
$message_array = ['message' => $this->_serializeMessage($data)];
if (array_key_exists('flags', $options)) {
$message_array['flags'] = $options['flags'];
}
$this->call->startBatch([
OP_SEND_MESSAGE => $message... | php | public function write($data, array $options = [])
{
$message_array = ['message' => $this->_serializeMessage($data)];
if (array_key_exists('flags', $options)) {
$message_array['flags'] = $options['flags'];
}
$this->call->startBatch([
OP_SEND_MESSAGE => $message... | [
"public",
"function",
"write",
"(",
"$",
"data",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"message_array",
"=",
"[",
"'message'",
"=>",
"$",
"this",
"->",
"_serializeMessage",
"(",
"$",
"data",
")",
"]",
";",
"if",
"(",
"array_key_... | Write a single message to the server. This cannot be called after
wait is called.
@param ByteBuffer $data The data to write
@param array $options An array of options, possible keys:
'flags' => a number (optional) | [
"Write",
"a",
"single",
"message",
"to",
"the",
"server",
".",
"This",
"cannot",
"be",
"called",
"after",
"wait",
"is",
"called",
"."
] | train | https://github.com/grpc/grpc-php/blob/0f1ffdde45bfb9257c5d9eab81695d0f042bea22/src/lib/ClientStreamingCall.php#L49-L58 |
grpc/grpc-php | src/lib/ClientStreamingCall.php | ClientStreamingCall.wait | public function wait()
{
$event = $this->call->startBatch([
OP_SEND_CLOSE_FROM_CLIENT => true,
OP_RECV_INITIAL_METADATA => true,
OP_RECV_MESSAGE => true,
OP_RECV_STATUS_ON_CLIENT => true,
]);
$this->metadata = $event->metadata;
$status... | php | public function wait()
{
$event = $this->call->startBatch([
OP_SEND_CLOSE_FROM_CLIENT => true,
OP_RECV_INITIAL_METADATA => true,
OP_RECV_MESSAGE => true,
OP_RECV_STATUS_ON_CLIENT => true,
]);
$this->metadata = $event->metadata;
$status... | [
"public",
"function",
"wait",
"(",
")",
"{",
"$",
"event",
"=",
"$",
"this",
"->",
"call",
"->",
"startBatch",
"(",
"[",
"OP_SEND_CLOSE_FROM_CLIENT",
"=>",
"true",
",",
"OP_RECV_INITIAL_METADATA",
"=>",
"true",
",",
"OP_RECV_MESSAGE",
"=>",
"true",
",",
"OP_... | Wait for the server to respond with data and a status.
@return array [response data, status] | [
"Wait",
"for",
"the",
"server",
"to",
"respond",
"with",
"data",
"and",
"a",
"status",
"."
] | train | https://github.com/grpc/grpc-php/blob/0f1ffdde45bfb9257c5d9eab81695d0f042bea22/src/lib/ClientStreamingCall.php#L65-L79 |
grpc/grpc-php | src/lib/ServerStreamingCall.php | ServerStreamingCall.start | public function start($data, array $metadata = [], array $options = [])
{
$message_array = ['message' => $this->_serializeMessage($data)];
if (array_key_exists('flags', $options)) {
$message_array['flags'] = $options['flags'];
}
$this->call->startBatch([
OP_SE... | php | public function start($data, array $metadata = [], array $options = [])
{
$message_array = ['message' => $this->_serializeMessage($data)];
if (array_key_exists('flags', $options)) {
$message_array['flags'] = $options['flags'];
}
$this->call->startBatch([
OP_SE... | [
"public",
"function",
"start",
"(",
"$",
"data",
",",
"array",
"$",
"metadata",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"message_array",
"=",
"[",
"'message'",
"=>",
"$",
"this",
"->",
"_serializeMessage",
"(",
"$",... | Start the call.
@param mixed $data The data to send
@param array $metadata Metadata to send with the call, if applicable
(optional)
@param array $options An array of options, possible keys:
'flags' => a number (optional) | [
"Start",
"the",
"call",
"."
] | train | https://github.com/grpc/grpc-php/blob/0f1ffdde45bfb9257c5d9eab81695d0f042bea22/src/lib/ServerStreamingCall.php#L37-L48 |
grpc/grpc-php | src/lib/ServerStreamingCall.php | ServerStreamingCall.getStatus | public function getStatus()
{
$status_event = $this->call->startBatch([
OP_RECV_STATUS_ON_CLIENT => true,
]);
$this->trailing_metadata = $status_event->status->metadata;
return $status_event->status;
} | php | public function getStatus()
{
$status_event = $this->call->startBatch([
OP_RECV_STATUS_ON_CLIENT => true,
]);
$this->trailing_metadata = $status_event->status->metadata;
return $status_event->status;
} | [
"public",
"function",
"getStatus",
"(",
")",
"{",
"$",
"status_event",
"=",
"$",
"this",
"->",
"call",
"->",
"startBatch",
"(",
"[",
"OP_RECV_STATUS_ON_CLIENT",
"=>",
"true",
",",
"]",
")",
";",
"$",
"this",
"->",
"trailing_metadata",
"=",
"$",
"status_eve... | Wait for the server to send the status, and return it.
@return \stdClass The status object, with integer $code, string
$details, and array $metadata members | [
"Wait",
"for",
"the",
"server",
"to",
"send",
"the",
"status",
"and",
"return",
"it",
"."
] | train | https://github.com/grpc/grpc-php/blob/0f1ffdde45bfb9257c5d9eab81695d0f042bea22/src/lib/ServerStreamingCall.php#L78-L87 |
grpc/grpc-php | src/lib/BidiStreamingCall.php | BidiStreamingCall.read | public function read()
{
$batch = [OP_RECV_MESSAGE => true];
if ($this->metadata === null) {
$batch[OP_RECV_INITIAL_METADATA] = true;
}
$read_event = $this->call->startBatch($batch);
if ($this->metadata === null) {
$this->metadata = $read_event->metada... | php | public function read()
{
$batch = [OP_RECV_MESSAGE => true];
if ($this->metadata === null) {
$batch[OP_RECV_INITIAL_METADATA] = true;
}
$read_event = $this->call->startBatch($batch);
if ($this->metadata === null) {
$this->metadata = $read_event->metada... | [
"public",
"function",
"read",
"(",
")",
"{",
"$",
"batch",
"=",
"[",
"OP_RECV_MESSAGE",
"=>",
"true",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"metadata",
"===",
"null",
")",
"{",
"$",
"batch",
"[",
"OP_RECV_INITIAL_METADATA",
"]",
"=",
"true",
";",
"... | Reads the next value from the server.
@return mixed The next value from the server, or null if there is none | [
"Reads",
"the",
"next",
"value",
"from",
"the",
"server",
"."
] | train | https://github.com/grpc/grpc-php/blob/0f1ffdde45bfb9257c5d9eab81695d0f042bea22/src/lib/BidiStreamingCall.php#L46-L58 |
grpc/grpc-php | src/lib/Interceptor.php | Interceptor.intercept | public static function intercept($channel, $interceptors)
{
if (is_array($interceptors)) {
for ($i = count($interceptors) - 1; $i >= 0; $i--) {
$channel = new Internal\InterceptorChannel($channel, $interceptors[$i]);
}
} else {
$channel = new Inte... | php | public static function intercept($channel, $interceptors)
{
if (is_array($interceptors)) {
for ($i = count($interceptors) - 1; $i >= 0; $i--) {
$channel = new Internal\InterceptorChannel($channel, $interceptors[$i]);
}
} else {
$channel = new Inte... | [
"public",
"static",
"function",
"intercept",
"(",
"$",
"channel",
",",
"$",
"interceptors",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"interceptors",
")",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"count",
"(",
"$",
"interceptors",
")",
"-",
"1",
";",
... | Intercept the methods with Channel
@param Channel|InterceptorChannel $channel An already created Channel or InterceptorChannel object (optional)
@param Interceptor|Interceptor[] $interceptors interceptors to be added
@return InterceptorChannel | [
"Intercept",
"the",
"methods",
"with",
"Channel"
] | train | https://github.com/grpc/grpc-php/blob/0f1ffdde45bfb9257c5d9eab81695d0f042bea22/src/lib/Interceptor.php#L80-L90 |
thephpleague/flysystem-aws-s3-v3 | src/AwsS3Adapter.php | AwsS3Adapter.write | public function write($path, $contents, Config $config)
{
return $this->upload($path, $contents, $config);
} | php | public function write($path, $contents, Config $config)
{
return $this->upload($path, $contents, $config);
} | [
"public",
"function",
"write",
"(",
"$",
"path",
",",
"$",
"contents",
",",
"Config",
"$",
"config",
")",
"{",
"return",
"$",
"this",
"->",
"upload",
"(",
"$",
"path",
",",
"$",
"contents",
",",
"$",
"config",
")",
";",
"}"
] | Write a new file.
@param string $path
@param string $contents
@param Config $config Config object
@return false|array false on failure file meta data on success | [
"Write",
"a",
"new",
"file",
"."
] | train | https://github.com/thephpleague/flysystem-aws-s3-v3/blob/883b02c80ca9cd68cf58a9b4b2185beef24b836b/src/AwsS3Adapter.php#L131-L134 |
thephpleague/flysystem-aws-s3-v3 | src/AwsS3Adapter.php | AwsS3Adapter.update | public function update($path, $contents, Config $config)
{
return $this->upload($path, $contents, $config);
} | php | public function update($path, $contents, Config $config)
{
return $this->upload($path, $contents, $config);
} | [
"public",
"function",
"update",
"(",
"$",
"path",
",",
"$",
"contents",
",",
"Config",
"$",
"config",
")",
"{",
"return",
"$",
"this",
"->",
"upload",
"(",
"$",
"path",
",",
"$",
"contents",
",",
"$",
"config",
")",
";",
"}"
] | Update a file.
@param string $path
@param string $contents
@param Config $config Config object
@return false|array false on failure file meta data on success | [
"Update",
"a",
"file",
"."
] | train | https://github.com/thephpleague/flysystem-aws-s3-v3/blob/883b02c80ca9cd68cf58a9b4b2185beef24b836b/src/AwsS3Adapter.php#L145-L148 |
thephpleague/flysystem-aws-s3-v3 | src/AwsS3Adapter.php | AwsS3Adapter.delete | public function delete($path)
{
$location = $this->applyPathPrefix($path);
$command = $this->s3Client->getCommand(
'deleteObject',
[
'Bucket' => $this->bucket,
'Key' => $location,
]
);
$this->s3Client->execute($... | php | public function delete($path)
{
$location = $this->applyPathPrefix($path);
$command = $this->s3Client->getCommand(
'deleteObject',
[
'Bucket' => $this->bucket,
'Key' => $location,
]
);
$this->s3Client->execute($... | [
"public",
"function",
"delete",
"(",
"$",
"path",
")",
"{",
"$",
"location",
"=",
"$",
"this",
"->",
"applyPathPrefix",
"(",
"$",
"path",
")",
";",
"$",
"command",
"=",
"$",
"this",
"->",
"s3Client",
"->",
"getCommand",
"(",
"'deleteObject'",
",",
"[",... | Delete a file.
@param string $path
@return bool | [
"Delete",
"a",
"file",
"."
] | train | https://github.com/thephpleague/flysystem-aws-s3-v3/blob/883b02c80ca9cd68cf58a9b4b2185beef24b836b/src/AwsS3Adapter.php#L174-L189 |
thephpleague/flysystem-aws-s3-v3 | src/AwsS3Adapter.php | AwsS3Adapter.deleteDir | public function deleteDir($dirname)
{
try {
$prefix = $this->applyPathPrefix($dirname) . '/';
$this->s3Client->deleteMatchingObjects($this->bucket, $prefix);
} catch (DeleteMultipleObjectsException $exception) {
return false;
}
return true;
} | php | public function deleteDir($dirname)
{
try {
$prefix = $this->applyPathPrefix($dirname) . '/';
$this->s3Client->deleteMatchingObjects($this->bucket, $prefix);
} catch (DeleteMultipleObjectsException $exception) {
return false;
}
return true;
} | [
"public",
"function",
"deleteDir",
"(",
"$",
"dirname",
")",
"{",
"try",
"{",
"$",
"prefix",
"=",
"$",
"this",
"->",
"applyPathPrefix",
"(",
"$",
"dirname",
")",
".",
"'/'",
";",
"$",
"this",
"->",
"s3Client",
"->",
"deleteMatchingObjects",
"(",
"$",
"... | Delete a directory.
@param string $dirname
@return bool | [
"Delete",
"a",
"directory",
"."
] | train | https://github.com/thephpleague/flysystem-aws-s3-v3/blob/883b02c80ca9cd68cf58a9b4b2185beef24b836b/src/AwsS3Adapter.php#L198-L208 |
thephpleague/flysystem-aws-s3-v3 | src/AwsS3Adapter.php | AwsS3Adapter.has | public function has($path)
{
$location = $this->applyPathPrefix($path);
if ($this->s3Client->doesObjectExist($this->bucket, $location, $this->options)) {
return true;
}
return $this->doesDirectoryExist($location);
} | php | public function has($path)
{
$location = $this->applyPathPrefix($path);
if ($this->s3Client->doesObjectExist($this->bucket, $location, $this->options)) {
return true;
}
return $this->doesDirectoryExist($location);
} | [
"public",
"function",
"has",
"(",
"$",
"path",
")",
"{",
"$",
"location",
"=",
"$",
"this",
"->",
"applyPathPrefix",
"(",
"$",
"path",
")",
";",
"if",
"(",
"$",
"this",
"->",
"s3Client",
"->",
"doesObjectExist",
"(",
"$",
"this",
"->",
"bucket",
",",... | Check whether a file exists.
@param string $path
@return bool | [
"Check",
"whether",
"a",
"file",
"exists",
"."
] | train | https://github.com/thephpleague/flysystem-aws-s3-v3/blob/883b02c80ca9cd68cf58a9b4b2185beef24b836b/src/AwsS3Adapter.php#L230-L239 |
thephpleague/flysystem-aws-s3-v3 | src/AwsS3Adapter.php | AwsS3Adapter.read | public function read($path)
{
$response = $this->readObject($path);
if ($response !== false) {
$response['contents'] = $response['contents']->getContents();
}
return $response;
} | php | public function read($path)
{
$response = $this->readObject($path);
if ($response !== false) {
$response['contents'] = $response['contents']->getContents();
}
return $response;
} | [
"public",
"function",
"read",
"(",
"$",
"path",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"readObject",
"(",
"$",
"path",
")",
";",
"if",
"(",
"$",
"response",
"!==",
"false",
")",
"{",
"$",
"response",
"[",
"'contents'",
"]",
"=",
"$",
... | Read a file.
@param string $path
@return false|array | [
"Read",
"a",
"file",
"."
] | train | https://github.com/thephpleague/flysystem-aws-s3-v3/blob/883b02c80ca9cd68cf58a9b4b2185beef24b836b/src/AwsS3Adapter.php#L248-L257 |
thephpleague/flysystem-aws-s3-v3 | src/AwsS3Adapter.php | AwsS3Adapter.listContents | public function listContents($directory = '', $recursive = false)
{
$prefix = $this->applyPathPrefix(rtrim($directory, '/') . '/');
$options = ['Bucket' => $this->bucket, 'Prefix' => ltrim($prefix, '/')];
if ($recursive === false) {
$options['Delimiter'] = '/';
}
... | php | public function listContents($directory = '', $recursive = false)
{
$prefix = $this->applyPathPrefix(rtrim($directory, '/') . '/');
$options = ['Bucket' => $this->bucket, 'Prefix' => ltrim($prefix, '/')];
if ($recursive === false) {
$options['Delimiter'] = '/';
}
... | [
"public",
"function",
"listContents",
"(",
"$",
"directory",
"=",
"''",
",",
"$",
"recursive",
"=",
"false",
")",
"{",
"$",
"prefix",
"=",
"$",
"this",
"->",
"applyPathPrefix",
"(",
"rtrim",
"(",
"$",
"directory",
",",
"'/'",
")",
".",
"'/'",
")",
";... | List contents of a directory.
@param string $directory
@param bool $recursive
@return array | [
"List",
"contents",
"of",
"a",
"directory",
"."
] | train | https://github.com/thephpleague/flysystem-aws-s3-v3/blob/883b02c80ca9cd68cf58a9b4b2185beef24b836b/src/AwsS3Adapter.php#L267-L281 |
thephpleague/flysystem-aws-s3-v3 | src/AwsS3Adapter.php | AwsS3Adapter.retrievePaginatedListing | protected function retrievePaginatedListing(array $options)
{
$resultPaginator = $this->s3Client->getPaginator('ListObjects', $options);
$listing = [];
foreach ($resultPaginator as $result) {
$listing = array_merge($listing, $result->get('Contents') ?: [], $result->get('CommonPr... | php | protected function retrievePaginatedListing(array $options)
{
$resultPaginator = $this->s3Client->getPaginator('ListObjects', $options);
$listing = [];
foreach ($resultPaginator as $result) {
$listing = array_merge($listing, $result->get('Contents') ?: [], $result->get('CommonPr... | [
"protected",
"function",
"retrievePaginatedListing",
"(",
"array",
"$",
"options",
")",
"{",
"$",
"resultPaginator",
"=",
"$",
"this",
"->",
"s3Client",
"->",
"getPaginator",
"(",
"'ListObjects'",
",",
"$",
"options",
")",
";",
"$",
"listing",
"=",
"[",
"]",... | @param array $options
@return array | [
"@param",
"array",
"$options"
] | train | https://github.com/thephpleague/flysystem-aws-s3-v3/blob/883b02c80ca9cd68cf58a9b4b2185beef24b836b/src/AwsS3Adapter.php#L288-L298 |
thephpleague/flysystem-aws-s3-v3 | src/AwsS3Adapter.php | AwsS3Adapter.getMetadata | public function getMetadata($path)
{
$command = $this->s3Client->getCommand(
'headObject',
[
'Bucket' => $this->bucket,
'Key' => $this->applyPathPrefix($path),
] + $this->options
);
/* @var Result $result */
try ... | php | public function getMetadata($path)
{
$command = $this->s3Client->getCommand(
'headObject',
[
'Bucket' => $this->bucket,
'Key' => $this->applyPathPrefix($path),
] + $this->options
);
/* @var Result $result */
try ... | [
"public",
"function",
"getMetadata",
"(",
"$",
"path",
")",
"{",
"$",
"command",
"=",
"$",
"this",
"->",
"s3Client",
"->",
"getCommand",
"(",
"'headObject'",
",",
"[",
"'Bucket'",
"=>",
"$",
"this",
"->",
"bucket",
",",
"'Key'",
"=>",
"$",
"this",
"->"... | Get all the meta data of a file or directory.
@param string $path
@return false|array | [
"Get",
"all",
"the",
"meta",
"data",
"of",
"a",
"file",
"or",
"directory",
"."
] | train | https://github.com/thephpleague/flysystem-aws-s3-v3/blob/883b02c80ca9cd68cf58a9b4b2185beef24b836b/src/AwsS3Adapter.php#L307-L331 |
thephpleague/flysystem-aws-s3-v3 | src/AwsS3Adapter.php | AwsS3Adapter.writeStream | public function writeStream($path, $resource, Config $config)
{
return $this->upload($path, $resource, $config);
} | php | public function writeStream($path, $resource, Config $config)
{
return $this->upload($path, $resource, $config);
} | [
"public",
"function",
"writeStream",
"(",
"$",
"path",
",",
"$",
"resource",
",",
"Config",
"$",
"config",
")",
"{",
"return",
"$",
"this",
"->",
"upload",
"(",
"$",
"path",
",",
"$",
"resource",
",",
"$",
"config",
")",
";",
"}"
] | Write a new file using a stream.
@param string $path
@param resource $resource
@param Config $config Config object
@return array|false false on failure file meta data on success | [
"Write",
"a",
"new",
"file",
"using",
"a",
"stream",
"."
] | train | https://github.com/thephpleague/flysystem-aws-s3-v3/blob/883b02c80ca9cd68cf58a9b4b2185beef24b836b/src/AwsS3Adapter.php#L378-L381 |
thephpleague/flysystem-aws-s3-v3 | src/AwsS3Adapter.php | AwsS3Adapter.updateStream | public function updateStream($path, $resource, Config $config)
{
return $this->upload($path, $resource, $config);
} | php | public function updateStream($path, $resource, Config $config)
{
return $this->upload($path, $resource, $config);
} | [
"public",
"function",
"updateStream",
"(",
"$",
"path",
",",
"$",
"resource",
",",
"Config",
"$",
"config",
")",
"{",
"return",
"$",
"this",
"->",
"upload",
"(",
"$",
"path",
",",
"$",
"resource",
",",
"$",
"config",
")",
";",
"}"
] | Update a file using a stream.
@param string $path
@param resource $resource
@param Config $config Config object
@return array|false false on failure file meta data on success | [
"Update",
"a",
"file",
"using",
"a",
"stream",
"."
] | train | https://github.com/thephpleague/flysystem-aws-s3-v3/blob/883b02c80ca9cd68cf58a9b4b2185beef24b836b/src/AwsS3Adapter.php#L392-L395 |
thephpleague/flysystem-aws-s3-v3 | src/AwsS3Adapter.php | AwsS3Adapter.copy | public function copy($path, $newpath)
{
$command = $this->s3Client->getCommand(
'copyObject',
[
'Bucket' => $this->bucket,
'Key' => $this->applyPathPrefix($newpath),
'CopySource' => urlencode($this->bucket . '/' . $this->appl... | php | public function copy($path, $newpath)
{
$command = $this->s3Client->getCommand(
'copyObject',
[
'Bucket' => $this->bucket,
'Key' => $this->applyPathPrefix($newpath),
'CopySource' => urlencode($this->bucket . '/' . $this->appl... | [
"public",
"function",
"copy",
"(",
"$",
"path",
",",
"$",
"newpath",
")",
"{",
"$",
"command",
"=",
"$",
"this",
"->",
"s3Client",
"->",
"getCommand",
"(",
"'copyObject'",
",",
"[",
"'Bucket'",
"=>",
"$",
"this",
"->",
"bucket",
",",
"'Key'",
"=>",
"... | Copy a file.
@param string $path
@param string $newpath
@return bool | [
"Copy",
"a",
"file",
"."
] | train | https://github.com/thephpleague/flysystem-aws-s3-v3/blob/883b02c80ca9cd68cf58a9b4b2185beef24b836b/src/AwsS3Adapter.php#L405-L425 |
thephpleague/flysystem-aws-s3-v3 | src/AwsS3Adapter.php | AwsS3Adapter.readStream | public function readStream($path)
{
$response = $this->readObject($path);
if ($response !== false) {
$response['stream'] = $response['contents']->detach();
unset($response['contents']);
}
return $response;
} | php | public function readStream($path)
{
$response = $this->readObject($path);
if ($response !== false) {
$response['stream'] = $response['contents']->detach();
unset($response['contents']);
}
return $response;
} | [
"public",
"function",
"readStream",
"(",
"$",
"path",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"readObject",
"(",
"$",
"path",
")",
";",
"if",
"(",
"$",
"response",
"!==",
"false",
")",
"{",
"$",
"response",
"[",
"'stream'",
"]",
"=",
"$"... | Read a file as a stream.
@param string $path
@return array|false | [
"Read",
"a",
"file",
"as",
"a",
"stream",
"."
] | train | https://github.com/thephpleague/flysystem-aws-s3-v3/blob/883b02c80ca9cd68cf58a9b4b2185beef24b836b/src/AwsS3Adapter.php#L434-L444 |
thephpleague/flysystem-aws-s3-v3 | src/AwsS3Adapter.php | AwsS3Adapter.readObject | protected function readObject($path)
{
$options = [
'Bucket' => $this->bucket,
'Key' => $this->applyPathPrefix($path),
];
if (isset($this->options['@http'])) {
$options['@http'] = $this->options['@http'];
}
$command = $this->s3Client->... | php | protected function readObject($path)
{
$options = [
'Bucket' => $this->bucket,
'Key' => $this->applyPathPrefix($path),
];
if (isset($this->options['@http'])) {
$options['@http'] = $this->options['@http'];
}
$command = $this->s3Client->... | [
"protected",
"function",
"readObject",
"(",
"$",
"path",
")",
"{",
"$",
"options",
"=",
"[",
"'Bucket'",
"=>",
"$",
"this",
"->",
"bucket",
",",
"'Key'",
"=>",
"$",
"this",
"->",
"applyPathPrefix",
"(",
"$",
"path",
")",
",",
"]",
";",
"if",
"(",
"... | Read an object and normalize the response.
@param $path
@return array|bool | [
"Read",
"an",
"object",
"and",
"normalize",
"the",
"response",
"."
] | train | https://github.com/thephpleague/flysystem-aws-s3-v3/blob/883b02c80ca9cd68cf58a9b4b2185beef24b836b/src/AwsS3Adapter.php#L453-L474 |
thephpleague/flysystem-aws-s3-v3 | src/AwsS3Adapter.php | AwsS3Adapter.setVisibility | public function setVisibility($path, $visibility)
{
$command = $this->s3Client->getCommand(
'putObjectAcl',
[
'Bucket' => $this->bucket,
'Key' => $this->applyPathPrefix($path),
'ACL' => $visibility === AdapterInterface::VISIBILITY... | php | public function setVisibility($path, $visibility)
{
$command = $this->s3Client->getCommand(
'putObjectAcl',
[
'Bucket' => $this->bucket,
'Key' => $this->applyPathPrefix($path),
'ACL' => $visibility === AdapterInterface::VISIBILITY... | [
"public",
"function",
"setVisibility",
"(",
"$",
"path",
",",
"$",
"visibility",
")",
"{",
"$",
"command",
"=",
"$",
"this",
"->",
"s3Client",
"->",
"getCommand",
"(",
"'putObjectAcl'",
",",
"[",
"'Bucket'",
"=>",
"$",
"this",
"->",
"bucket",
",",
"'Key'... | Set the visibility for a file.
@param string $path
@param string $visibility
@return array|false file meta data | [
"Set",
"the",
"visibility",
"for",
"a",
"file",
"."
] | train | https://github.com/thephpleague/flysystem-aws-s3-v3/blob/883b02c80ca9cd68cf58a9b4b2185beef24b836b/src/AwsS3Adapter.php#L484-L502 |
thephpleague/flysystem-aws-s3-v3 | src/AwsS3Adapter.php | AwsS3Adapter.getRawVisibility | protected function getRawVisibility($path)
{
$command = $this->s3Client->getCommand(
'getObjectAcl',
[
'Bucket' => $this->bucket,
'Key' => $this->applyPathPrefix($path),
]
);
$result = $this->s3Client->execute($command);... | php | protected function getRawVisibility($path)
{
$command = $this->s3Client->getCommand(
'getObjectAcl',
[
'Bucket' => $this->bucket,
'Key' => $this->applyPathPrefix($path),
]
);
$result = $this->s3Client->execute($command);... | [
"protected",
"function",
"getRawVisibility",
"(",
"$",
"path",
")",
"{",
"$",
"command",
"=",
"$",
"this",
"->",
"s3Client",
"->",
"getCommand",
"(",
"'getObjectAcl'",
",",
"[",
"'Bucket'",
"=>",
"$",
"this",
"->",
"bucket",
",",
"'Key'",
"=>",
"$",
"thi... | Get the object acl presented as a visibility.
@param string $path
@return string | [
"Get",
"the",
"object",
"acl",
"presented",
"as",
"a",
"visibility",
"."
] | train | https://github.com/thephpleague/flysystem-aws-s3-v3/blob/883b02c80ca9cd68cf58a9b4b2185beef24b836b/src/AwsS3Adapter.php#L541-L566 |
thephpleague/flysystem-aws-s3-v3 | src/AwsS3Adapter.php | AwsS3Adapter.upload | protected function upload($path, $body, Config $config)
{
$key = $this->applyPathPrefix($path);
$options = $this->getOptionsFromConfig($config);
$acl = array_key_exists('ACL', $options) ? $options['ACL'] : 'private';
if ( ! isset($options['ContentType'])) {
$options['Con... | php | protected function upload($path, $body, Config $config)
{
$key = $this->applyPathPrefix($path);
$options = $this->getOptionsFromConfig($config);
$acl = array_key_exists('ACL', $options) ? $options['ACL'] : 'private';
if ( ! isset($options['ContentType'])) {
$options['Con... | [
"protected",
"function",
"upload",
"(",
"$",
"path",
",",
"$",
"body",
",",
"Config",
"$",
"config",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"applyPathPrefix",
"(",
"$",
"path",
")",
";",
"$",
"options",
"=",
"$",
"this",
"->",
"getOptionsFromC... | Upload an object.
@param $path
@param $body
@param Config $config
@return array|bool | [
"Upload",
"an",
"object",
"."
] | train | https://github.com/thephpleague/flysystem-aws-s3-v3/blob/883b02c80ca9cd68cf58a9b4b2185beef24b836b/src/AwsS3Adapter.php#L577-L602 |
thephpleague/flysystem-aws-s3-v3 | src/AwsS3Adapter.php | AwsS3Adapter.getOptionsFromConfig | protected function getOptionsFromConfig(Config $config)
{
$options = $this->options;
if ($visibility = $config->get('visibility')) {
// For local reference
$options['visibility'] = $visibility;
// For external reference
$options['ACL'] = $visibility =... | php | protected function getOptionsFromConfig(Config $config)
{
$options = $this->options;
if ($visibility = $config->get('visibility')) {
// For local reference
$options['visibility'] = $visibility;
// For external reference
$options['ACL'] = $visibility =... | [
"protected",
"function",
"getOptionsFromConfig",
"(",
"Config",
"$",
"config",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"options",
";",
"if",
"(",
"$",
"visibility",
"=",
"$",
"config",
"->",
"get",
"(",
"'visibility'",
")",
")",
"{",
"// For lo... | Get options from the config.
@param Config $config
@return array | [
"Get",
"options",
"from",
"the",
"config",
"."
] | train | https://github.com/thephpleague/flysystem-aws-s3-v3/blob/883b02c80ca9cd68cf58a9b4b2185beef24b836b/src/AwsS3Adapter.php#L611-L637 |
thephpleague/flysystem-aws-s3-v3 | src/AwsS3Adapter.php | AwsS3Adapter.normalizeResponse | protected function normalizeResponse(array $response, $path = null)
{
$result = [
'path' => $path ?: $this->removePathPrefix(
isset($response['Key']) ? $response['Key'] : $response['Prefix']
),
];
$result = array_merge($result, Util::pathinfo($result['... | php | protected function normalizeResponse(array $response, $path = null)
{
$result = [
'path' => $path ?: $this->removePathPrefix(
isset($response['Key']) ? $response['Key'] : $response['Prefix']
),
];
$result = array_merge($result, Util::pathinfo($result['... | [
"protected",
"function",
"normalizeResponse",
"(",
"array",
"$",
"response",
",",
"$",
"path",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"[",
"'path'",
"=>",
"$",
"path",
"?",
":",
"$",
"this",
"->",
"removePathPrefix",
"(",
"isset",
"(",
"$",
"respon... | Normalize the object result array.
@param array $response
@param string $path
@return array | [
"Normalize",
"the",
"object",
"result",
"array",
"."
] | train | https://github.com/thephpleague/flysystem-aws-s3-v3/blob/883b02c80ca9cd68cf58a9b4b2185beef24b836b/src/AwsS3Adapter.php#L647-L668 |
thephpleague/flysystem-aws-s3-v3 | src/AwsS3Adapter.php | AwsS3Adapter.doesDirectoryExist | protected function doesDirectoryExist($location)
{
// Maybe this isn't an actual key, but a prefix.
// Do a prefix listing of objects to determine.
$command = $this->s3Client->getCommand(
'listObjects',
[
'Bucket' => $this->bucket,
'Pr... | php | protected function doesDirectoryExist($location)
{
// Maybe this isn't an actual key, but a prefix.
// Do a prefix listing of objects to determine.
$command = $this->s3Client->getCommand(
'listObjects',
[
'Bucket' => $this->bucket,
'Pr... | [
"protected",
"function",
"doesDirectoryExist",
"(",
"$",
"location",
")",
"{",
"// Maybe this isn't an actual key, but a prefix.",
"// Do a prefix listing of objects to determine.",
"$",
"command",
"=",
"$",
"this",
"->",
"s3Client",
"->",
"getCommand",
"(",
"'listObjects'",
... | @param $location
@return bool | [
"@param",
"$location"
] | train | https://github.com/thephpleague/flysystem-aws-s3-v3/blob/883b02c80ca9cd68cf58a9b4b2185beef24b836b/src/AwsS3Adapter.php#L675-L699 |
laravel/slack-notification-channel | src/SlackChannelServiceProvider.php | SlackChannelServiceProvider.register | public function register()
{
Notification::resolved(function (ChannelManager $service) {
$service->extend('slack', function ($app) {
return new Channels\SlackWebhookChannel(new HttpClient);
});
});
} | php | public function register()
{
Notification::resolved(function (ChannelManager $service) {
$service->extend('slack', function ($app) {
return new Channels\SlackWebhookChannel(new HttpClient);
});
});
} | [
"public",
"function",
"register",
"(",
")",
"{",
"Notification",
"::",
"resolved",
"(",
"function",
"(",
"ChannelManager",
"$",
"service",
")",
"{",
"$",
"service",
"->",
"extend",
"(",
"'slack'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"return",
"ne... | Register the service provider.
@return void | [
"Register",
"the",
"service",
"provider",
"."
] | train | https://github.com/laravel/slack-notification-channel/blob/a9abc2238d75ae7d75931d4c2d9faaa97f32279f/src/SlackChannelServiceProvider.php#L16-L23 |
laravel/slack-notification-channel | src/Messages/SlackMessage.php | SlackMessage.from | public function from($username, $icon = null)
{
$this->username = $username;
if (! is_null($icon)) {
$this->icon = $icon;
}
return $this;
} | php | public function from($username, $icon = null)
{
$this->username = $username;
if (! is_null($icon)) {
$this->icon = $icon;
}
return $this;
} | [
"public",
"function",
"from",
"(",
"$",
"username",
",",
"$",
"icon",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"username",
"=",
"$",
"username",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"icon",
")",
")",
"{",
"$",
"this",
"->",
"icon",
"=",
"... | Set a custom username and optional emoji icon for the Slack message.
@param string $username
@param string|null $icon
@return $this | [
"Set",
"a",
"custom",
"username",
"and",
"optional",
"emoji",
"icon",
"for",
"the",
"Slack",
"message",
"."
] | train | https://github.com/laravel/slack-notification-channel/blob/a9abc2238d75ae7d75931d4c2d9faaa97f32279f/src/Messages/SlackMessage.php#L141-L150 |
laravel/slack-notification-channel | src/Messages/SlackMessage.php | SlackMessage.attachment | public function attachment(Closure $callback)
{
$this->attachments[] = $attachment = new SlackAttachment;
$callback($attachment);
return $this;
} | php | public function attachment(Closure $callback)
{
$this->attachments[] = $attachment = new SlackAttachment;
$callback($attachment);
return $this;
} | [
"public",
"function",
"attachment",
"(",
"Closure",
"$",
"callback",
")",
"{",
"$",
"this",
"->",
"attachments",
"[",
"]",
"=",
"$",
"attachment",
"=",
"new",
"SlackAttachment",
";",
"$",
"callback",
"(",
"$",
"attachment",
")",
";",
"return",
"$",
"this... | Define an attachment for the message.
@param \Closure $callback
@return $this | [
"Define",
"an",
"attachment",
"for",
"the",
"message",
"."
] | train | https://github.com/laravel/slack-notification-channel/blob/a9abc2238d75ae7d75931d4c2d9faaa97f32279f/src/Messages/SlackMessage.php#L197-L204 |
laravel/slack-notification-channel | src/Messages/SlackAttachment.php | SlackAttachment.title | public function title($title, $url = null)
{
$this->title = $title;
$this->url = $url;
return $this;
} | php | public function title($title, $url = null)
{
$this->title = $title;
$this->url = $url;
return $this;
} | [
"public",
"function",
"title",
"(",
"$",
"title",
",",
"$",
"url",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"title",
"=",
"$",
"title",
";",
"$",
"this",
"->",
"url",
"=",
"$",
"url",
";",
"return",
"$",
"this",
";",
"}"
] | Set the title of the attachment.
@param string $title
@param string|null $url
@return $this | [
"Set",
"the",
"title",
"of",
"the",
"attachment",
"."
] | train | https://github.com/laravel/slack-notification-channel/blob/a9abc2238d75ae7d75931d4c2d9faaa97f32279f/src/Messages/SlackAttachment.php#L137-L143 |
laravel/slack-notification-channel | src/Messages/SlackAttachment.php | SlackAttachment.field | public function field($title, $content = '')
{
if (is_callable($title)) {
$callback = $title;
$callback($attachmentField = new SlackAttachmentField);
$this->fields[] = $attachmentField;
return $this;
}
$this->fields[$title] = $content;
... | php | public function field($title, $content = '')
{
if (is_callable($title)) {
$callback = $title;
$callback($attachmentField = new SlackAttachmentField);
$this->fields[] = $attachmentField;
return $this;
}
$this->fields[$title] = $content;
... | [
"public",
"function",
"field",
"(",
"$",
"title",
",",
"$",
"content",
"=",
"''",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"title",
")",
")",
"{",
"$",
"callback",
"=",
"$",
"title",
";",
"$",
"callback",
"(",
"$",
"attachmentField",
"=",
"new... | Add a field to the attachment.
@param \Closure|string $title
@param string $content
@return $this | [
"Add",
"a",
"field",
"to",
"the",
"attachment",
"."
] | train | https://github.com/laravel/slack-notification-channel/blob/a9abc2238d75ae7d75931d4c2d9faaa97f32279f/src/Messages/SlackAttachment.php#L204-L219 |
laravel/slack-notification-channel | src/Messages/SlackAttachment.php | SlackAttachment.action | public function action($title, $url, $style = '')
{
$this->actions[] = [
'type' => 'button',
'text' => $title,
'url' => $url,
'style' => $style,
];
return $this;
} | php | public function action($title, $url, $style = '')
{
$this->actions[] = [
'type' => 'button',
'text' => $title,
'url' => $url,
'style' => $style,
];
return $this;
} | [
"public",
"function",
"action",
"(",
"$",
"title",
",",
"$",
"url",
",",
"$",
"style",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"actions",
"[",
"]",
"=",
"[",
"'type'",
"=>",
"'button'",
",",
"'text'",
"=>",
"$",
"title",
",",
"'url'",
"=>",
"$",
... | Add an action (button) under the attachment.
@param string $title
@param string $url
@param string $style
@return $this | [
"Add",
"an",
"action",
"(",
"button",
")",
"under",
"the",
"attachment",
"."
] | train | https://github.com/laravel/slack-notification-channel/blob/a9abc2238d75ae7d75931d4c2d9faaa97f32279f/src/Messages/SlackAttachment.php#L281-L291 |
laravel/slack-notification-channel | src/Messages/SlackAttachment.php | SlackAttachment.author | public function author($name, $link = null, $icon = null)
{
$this->authorName = $name;
$this->authorLink = $link;
$this->authorIcon = $icon;
return $this;
} | php | public function author($name, $link = null, $icon = null)
{
$this->authorName = $name;
$this->authorLink = $link;
$this->authorIcon = $icon;
return $this;
} | [
"public",
"function",
"author",
"(",
"$",
"name",
",",
"$",
"link",
"=",
"null",
",",
"$",
"icon",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"authorName",
"=",
"$",
"name",
";",
"$",
"this",
"->",
"authorLink",
"=",
"$",
"link",
";",
"$",
"this",... | Set the author of the attachment.
@param string $name
@param string|null $link
@param string|null $icon
@return $this | [
"Set",
"the",
"author",
"of",
"the",
"attachment",
"."
] | train | https://github.com/laravel/slack-notification-channel/blob/a9abc2238d75ae7d75931d4c2d9faaa97f32279f/src/Messages/SlackAttachment.php#L301-L308 |
laravel/slack-notification-channel | src/Channels/SlackWebhookChannel.php | SlackWebhookChannel.send | public function send($notifiable, Notification $notification)
{
if (! $url = $notifiable->routeNotificationFor('slack', $notification)) {
return;
}
$this->http->post($url, $this->buildJsonPayload(
$notification->toSlack($notifiable)
));
} | php | public function send($notifiable, Notification $notification)
{
if (! $url = $notifiable->routeNotificationFor('slack', $notification)) {
return;
}
$this->http->post($url, $this->buildJsonPayload(
$notification->toSlack($notifiable)
));
} | [
"public",
"function",
"send",
"(",
"$",
"notifiable",
",",
"Notification",
"$",
"notification",
")",
"{",
"if",
"(",
"!",
"$",
"url",
"=",
"$",
"notifiable",
"->",
"routeNotificationFor",
"(",
"'slack'",
",",
"$",
"notification",
")",
")",
"{",
"return",
... | Send the given notification.
@param mixed $notifiable
@param \Illuminate\Notifications\Notification $notification
@return void | [
"Send",
"the",
"given",
"notification",
"."
] | train | https://github.com/laravel/slack-notification-channel/blob/a9abc2238d75ae7d75931d4c2d9faaa97f32279f/src/Channels/SlackWebhookChannel.php#L38-L47 |
laravel/slack-notification-channel | src/Channels/SlackWebhookChannel.php | SlackWebhookChannel.buildJsonPayload | protected function buildJsonPayload(SlackMessage $message)
{
$optionalFields = array_filter([
'channel' => data_get($message, 'channel'),
'icon_emoji' => data_get($message, 'icon'),
'icon_url' => data_get($message, 'image'),
'link_names' => data_get($message, ... | php | protected function buildJsonPayload(SlackMessage $message)
{
$optionalFields = array_filter([
'channel' => data_get($message, 'channel'),
'icon_emoji' => data_get($message, 'icon'),
'icon_url' => data_get($message, 'image'),
'link_names' => data_get($message, ... | [
"protected",
"function",
"buildJsonPayload",
"(",
"SlackMessage",
"$",
"message",
")",
"{",
"$",
"optionalFields",
"=",
"array_filter",
"(",
"[",
"'channel'",
"=>",
"data_get",
"(",
"$",
"message",
",",
"'channel'",
")",
",",
"'icon_emoji'",
"=>",
"data_get",
... | Build up a JSON payload for the Slack webhook.
@param \Illuminate\Notifications\Messages\SlackMessage $message
@return array | [
"Build",
"up",
"a",
"JSON",
"payload",
"for",
"the",
"Slack",
"webhook",
"."
] | train | https://github.com/laravel/slack-notification-channel/blob/a9abc2238d75ae7d75931d4c2d9faaa97f32279f/src/Channels/SlackWebhookChannel.php#L55-L73 |
laravel/slack-notification-channel | src/Channels/SlackWebhookChannel.php | SlackWebhookChannel.attachments | protected function attachments(SlackMessage $message)
{
return collect($message->attachments)->map(function ($attachment) use ($message) {
return array_filter([
'actions' => $attachment->actions,
'author_icon' => $attachment->authorIcon,
'author_li... | php | protected function attachments(SlackMessage $message)
{
return collect($message->attachments)->map(function ($attachment) use ($message) {
return array_filter([
'actions' => $attachment->actions,
'author_icon' => $attachment->authorIcon,
'author_li... | [
"protected",
"function",
"attachments",
"(",
"SlackMessage",
"$",
"message",
")",
"{",
"return",
"collect",
"(",
"$",
"message",
"->",
"attachments",
")",
"->",
"map",
"(",
"function",
"(",
"$",
"attachment",
")",
"use",
"(",
"$",
"message",
")",
"{",
"r... | Format the message's attachments.
@param \Illuminate\Notifications\Messages\SlackMessage $message
@return array | [
"Format",
"the",
"message",
"s",
"attachments",
"."
] | train | https://github.com/laravel/slack-notification-channel/blob/a9abc2238d75ae7d75931d4c2d9faaa97f32279f/src/Channels/SlackWebhookChannel.php#L81-L104 |
lovata/oc-shopaholic-plugin | classes/store/PromoBlockListStore.php | PromoBlockListStore.init | protected function init()
{
$this->addToStoreList('active', ActiveListStore::class);
$this->addToStoreList('sorting', SortingListStore::class);
$this->addToStoreList('hidden', HiddenListStore::class);
$this->addToStoreList('not_hidden', NotHiddenListStore::class);
} | php | protected function init()
{
$this->addToStoreList('active', ActiveListStore::class);
$this->addToStoreList('sorting', SortingListStore::class);
$this->addToStoreList('hidden', HiddenListStore::class);
$this->addToStoreList('not_hidden', NotHiddenListStore::class);
} | [
"protected",
"function",
"init",
"(",
")",
"{",
"$",
"this",
"->",
"addToStoreList",
"(",
"'active'",
",",
"ActiveListStore",
"::",
"class",
")",
";",
"$",
"this",
"->",
"addToStoreList",
"(",
"'sorting'",
",",
"SortingListStore",
"::",
"class",
")",
";",
... | Init store method | [
"Init",
"store",
"method"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/store/PromoBlockListStore.php#L32-L38 |
lovata/oc-shopaholic-plugin | classes/item/ProductItem.php | ProductItem.getPageParamList | public function getPageParamList($sPageCode) : array
{
$arPageParamList = [];
//Get URL params for categories
$aCategoryParamList = $this->category->getPageParamList($sPageCode);
$aBrandParamList = $this->brand->getPageParamList($sPageCode);
//Get URL params for page
... | php | public function getPageParamList($sPageCode) : array
{
$arPageParamList = [];
//Get URL params for categories
$aCategoryParamList = $this->category->getPageParamList($sPageCode);
$aBrandParamList = $this->brand->getPageParamList($sPageCode);
//Get URL params for page
... | [
"public",
"function",
"getPageParamList",
"(",
"$",
"sPageCode",
")",
":",
"array",
"{",
"$",
"arPageParamList",
"=",
"[",
"]",
";",
"//Get URL params for categories",
"$",
"aCategoryParamList",
"=",
"$",
"this",
"->",
"category",
"->",
"getPageParamList",
"(",
... | Get URL param list by page code
@param string $sPageCode
@return array | [
"Get",
"URL",
"param",
"list",
"by",
"page",
"code"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/item/ProductItem.php#L129-L147 |
lovata/oc-shopaholic-plugin | classes/item/ProductItem.php | ProductItem.getElementData | protected function getElementData()
{
$arResult = [
'offer_id_list' => $this->obElement->offer()->active()->lists('id'),
'additional_category_id' => $this->obElement->additional_category()->lists('id'),
'trashed' => $this->obElement->trashed(),
... | php | protected function getElementData()
{
$arResult = [
'offer_id_list' => $this->obElement->offer()->active()->lists('id'),
'additional_category_id' => $this->obElement->additional_category()->lists('id'),
'trashed' => $this->obElement->trashed(),
... | [
"protected",
"function",
"getElementData",
"(",
")",
"{",
"$",
"arResult",
"=",
"[",
"'offer_id_list'",
"=>",
"$",
"this",
"->",
"obElement",
"->",
"offer",
"(",
")",
"->",
"active",
"(",
")",
"->",
"lists",
"(",
"'id'",
")",
",",
"'additional_category_id'... | Set element data from model object
@return array | [
"Set",
"element",
"data",
"from",
"model",
"object"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/item/ProductItem.php#L162-L171 |
lovata/oc-shopaholic-plugin | components/PromoBlockPage.php | PromoBlockPage.getElementObject | protected function getElementObject($sElementSlug)
{
if (empty($sElementSlug)) {
return null;
}
if ($this->isSlugTranslatable()) {
$obElement = PromoBlock::active()->transWhere('slug', $sElementSlug)->first();
if (!$this->checkTransSlug($obElement, $sElem... | php | protected function getElementObject($sElementSlug)
{
if (empty($sElementSlug)) {
return null;
}
if ($this->isSlugTranslatable()) {
$obElement = PromoBlock::active()->transWhere('slug', $sElementSlug)->first();
if (!$this->checkTransSlug($obElement, $sElem... | [
"protected",
"function",
"getElementObject",
"(",
"$",
"sElementSlug",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"sElementSlug",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"isSlugTranslatable",
"(",
")",
")",
"{",
"$",
"obEl... | Get element object
@param string $sElementSlug
@return PromoBlock | [
"Get",
"element",
"object"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/components/PromoBlockPage.php#L42-L62 |
lovata/oc-shopaholic-plugin | classes/import/ImportCategoryModel.php | ImportCategoryModel.prepareImportData | protected function prepareImportData()
{
$this->initParentCategory();
$this->setActiveField();
$this->initPreviewImage();
$this->initImageList();
parent::prepareImportData();
} | php | protected function prepareImportData()
{
$this->initParentCategory();
$this->setActiveField();
$this->initPreviewImage();
$this->initImageList();
parent::prepareImportData();
} | [
"protected",
"function",
"prepareImportData",
"(",
")",
"{",
"$",
"this",
"->",
"initParentCategory",
"(",
")",
";",
"$",
"this",
"->",
"setActiveField",
"(",
")",
";",
"$",
"this",
"->",
"initPreviewImage",
"(",
")",
";",
"$",
"this",
"->",
"initImageList... | Prepare array of import data | [
"Prepare",
"array",
"of",
"import",
"data"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/import/ImportCategoryModel.php#L41-L50 |
lovata/oc-shopaholic-plugin | classes/import/ImportCategoryModel.php | ImportCategoryModel.processModelObject | protected function processModelObject()
{
if ($this->obParentCategory === false) {
$this->obModel->parent_id = null;
$this->obModel->save();
} elseif (!empty($this->obParentCategory)) {
$this->obModel->makeChildOf($this->obParentCategory);
}
$this... | php | protected function processModelObject()
{
if ($this->obParentCategory === false) {
$this->obModel->parent_id = null;
$this->obModel->save();
} elseif (!empty($this->obParentCategory)) {
$this->obModel->makeChildOf($this->obParentCategory);
}
$this... | [
"protected",
"function",
"processModelObject",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"obParentCategory",
"===",
"false",
")",
"{",
"$",
"this",
"->",
"obModel",
"->",
"parent_id",
"=",
"null",
";",
"$",
"this",
"->",
"obModel",
"->",
"save",
"(",
... | Process model object after creation/updating | [
"Process",
"model",
"object",
"after",
"creation",
"/",
"updating"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/import/ImportCategoryModel.php#L55-L66 |
lovata/oc-shopaholic-plugin | classes/import/ImportCategoryModel.php | ImportCategoryModel.initParentCategory | protected function initParentCategory()
{
if (!array_key_exists('parent_id', $this->arImportData)) {
return;
}
$iParentID = array_get($this->arImportData, 'parent_id');
array_forget($this->arImportData, 'parent_id');
if (empty($iParentID)) {
$this->ob... | php | protected function initParentCategory()
{
if (!array_key_exists('parent_id', $this->arImportData)) {
return;
}
$iParentID = array_get($this->arImportData, 'parent_id');
array_forget($this->arImportData, 'parent_id');
if (empty($iParentID)) {
$this->ob... | [
"protected",
"function",
"initParentCategory",
"(",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"'parent_id'",
",",
"$",
"this",
"->",
"arImportData",
")",
")",
"{",
"return",
";",
"}",
"$",
"iParentID",
"=",
"array_get",
"(",
"$",
"this",
"->",
"... | Find parent category by external ID and set parent_id | [
"Find",
"parent",
"category",
"by",
"external",
"ID",
"and",
"set",
"parent_id"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/import/ImportCategoryModel.php#L71-L87 |
lovata/oc-shopaholic-plugin | classes/import/ImportOfferModel.php | ImportOfferModel.prepareImportData | protected function prepareImportData()
{
$this->setActiveField();
$this->setProductField();
$this->setQuantityField();
$this->initPreviewImage();
$this->initImageList();
parent::prepareImportData();
} | php | protected function prepareImportData()
{
$this->setActiveField();
$this->setProductField();
$this->setQuantityField();
$this->initPreviewImage();
$this->initImageList();
parent::prepareImportData();
} | [
"protected",
"function",
"prepareImportData",
"(",
")",
"{",
"$",
"this",
"->",
"setActiveField",
"(",
")",
";",
"$",
"this",
"->",
"setProductField",
"(",
")",
";",
"$",
"this",
"->",
"setQuantityField",
"(",
")",
";",
"$",
"this",
"->",
"initPreviewImage... | Prepare array of import data | [
"Prepare",
"array",
"of",
"import",
"data"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/import/ImportOfferModel.php#L41-L51 |
lovata/oc-shopaholic-plugin | classes/import/ImportOfferModel.php | ImportOfferModel.setProductField | protected function setProductField()
{
$sProductID = array_get($this->arImportData, 'product_id');
if ($sProductID === null) {
return;
}
//Find product by external ID
$obProduct = Product::withTrashed()->getByExternalID($sProductID)->first();
if (empty($o... | php | protected function setProductField()
{
$sProductID = array_get($this->arImportData, 'product_id');
if ($sProductID === null) {
return;
}
//Find product by external ID
$obProduct = Product::withTrashed()->getByExternalID($sProductID)->first();
if (empty($o... | [
"protected",
"function",
"setProductField",
"(",
")",
"{",
"$",
"sProductID",
"=",
"array_get",
"(",
"$",
"this",
"->",
"arImportData",
",",
"'product_id'",
")",
";",
"if",
"(",
"$",
"sProductID",
"===",
"null",
")",
"{",
"return",
";",
"}",
"//Find produc... | Set product_id filed value | [
"Set",
"product_id",
"filed",
"value"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/import/ImportOfferModel.php#L65-L79 |
lovata/oc-shopaholic-plugin | classes/import/ImportOfferModel.php | ImportOfferModel.setQuantityField | protected function setQuantityField()
{
$iQuantity = array_get($this->arImportData, 'quantity');
if ($iQuantity === null) {
return;
}
$iQuantity = (int) $iQuantity;
if ($iQuantity < 0) {
$iQuantity = 0;
}
$this->arImportData['quantity... | php | protected function setQuantityField()
{
$iQuantity = array_get($this->arImportData, 'quantity');
if ($iQuantity === null) {
return;
}
$iQuantity = (int) $iQuantity;
if ($iQuantity < 0) {
$iQuantity = 0;
}
$this->arImportData['quantity... | [
"protected",
"function",
"setQuantityField",
"(",
")",
"{",
"$",
"iQuantity",
"=",
"array_get",
"(",
"$",
"this",
"->",
"arImportData",
",",
"'quantity'",
")",
";",
"if",
"(",
"$",
"iQuantity",
"===",
"null",
")",
"{",
"return",
";",
"}",
"$",
"iQuantity... | Set quantity field value | [
"Set",
"quantity",
"field",
"value"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/import/ImportOfferModel.php#L84-L97 |
lovata/oc-shopaholic-plugin | classes/helper/PriceTypeHelper.php | PriceTypeHelper.initActivePriceType | protected function initActivePriceType()
{
$this->obActivePriceType = null;
if (!empty($this->sActivePriceTypeCode)) {
$this->obActivePriceType = $this->obPriceTypeList->where('code', $this->sActivePriceTypeCode)->first();
}
} | php | protected function initActivePriceType()
{
$this->obActivePriceType = null;
if (!empty($this->sActivePriceTypeCode)) {
$this->obActivePriceType = $this->obPriceTypeList->where('code', $this->sActivePriceTypeCode)->first();
}
} | [
"protected",
"function",
"initActivePriceType",
"(",
")",
"{",
"$",
"this",
"->",
"obActivePriceType",
"=",
"null",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"sActivePriceTypeCode",
")",
")",
"{",
"$",
"this",
"->",
"obActivePriceType",
"=",
"$... | Get active currency code and find active currency object by code | [
"Get",
"active",
"currency",
"code",
"and",
"find",
"active",
"currency",
"object",
"by",
"code"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/helper/PriceTypeHelper.php#L84-L90 |
lovata/oc-shopaholic-plugin | classes/store/product/ActiveListStore.php | ActiveListStore.getIDListFromDB | protected function getIDListFromDB() : array
{
//Get product ID list
$arProductIDList = (array) Product::active()->lists('id');
if (empty($arProductIDList)) {
return [];
}
//Check active offers
if (Settings::getValue('check_offer_active')) {
/... | php | protected function getIDListFromDB() : array
{
//Get product ID list
$arProductIDList = (array) Product::active()->lists('id');
if (empty($arProductIDList)) {
return [];
}
//Check active offers
if (Settings::getValue('check_offer_active')) {
/... | [
"protected",
"function",
"getIDListFromDB",
"(",
")",
":",
"array",
"{",
"//Get product ID list",
"$",
"arProductIDList",
"=",
"(",
"array",
")",
"Product",
"::",
"active",
"(",
")",
"->",
"lists",
"(",
"'id'",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"ar... | Get ID list from database
@return array | [
"Get",
"ID",
"list",
"from",
"database"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/store/product/ActiveListStore.php#L22-L42 |
lovata/oc-shopaholic-plugin | classes/event/price/PriceModelHandler.php | PriceModelHandler.subscribe | public function subscribe()
{
$sModelClass = $this->getModelClass();
$sModelClass::extend(function ($obElement) {
/** @var \Model $obElement */
$obElement->bindEvent('model.afterSave', function () use ($obElement) {
$this->obElement = $obElement;
... | php | public function subscribe()
{
$sModelClass = $this->getModelClass();
$sModelClass::extend(function ($obElement) {
/** @var \Model $obElement */
$obElement->bindEvent('model.afterSave', function () use ($obElement) {
$this->obElement = $obElement;
... | [
"public",
"function",
"subscribe",
"(",
")",
"{",
"$",
"sModelClass",
"=",
"$",
"this",
"->",
"getModelClass",
"(",
")",
";",
"$",
"sModelClass",
"::",
"extend",
"(",
"function",
"(",
"$",
"obElement",
")",
"{",
"/** @var \\Model $obElement */",
"$",
"obElem... | Add listeners | [
"Add",
"listeners"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/event/price/PriceModelHandler.php#L28-L45 |
lovata/oc-shopaholic-plugin | classes/event/price/PriceModelHandler.php | PriceModelHandler.clearPriceCache | protected function clearPriceCache()
{
$obItem = $this->obElement->item;
if (empty($obItem)) {
return;
}
if ($obItem instanceof Offer) {
$sSorting = !empty($this->obElement->price_type) ? '|'.$this->obElement->price_type : '';
OfferListStore::in... | php | protected function clearPriceCache()
{
$obItem = $this->obElement->item;
if (empty($obItem)) {
return;
}
if ($obItem instanceof Offer) {
$sSorting = !empty($this->obElement->price_type) ? '|'.$this->obElement->price_type : '';
OfferListStore::in... | [
"protected",
"function",
"clearPriceCache",
"(",
")",
"{",
"$",
"obItem",
"=",
"$",
"this",
"->",
"obElement",
"->",
"item",
";",
"if",
"(",
"empty",
"(",
"$",
"obItem",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"obItem",
"instanceof",
"Offe... | Clear product/offer price cache | [
"Clear",
"product",
"/",
"offer",
"price",
"cache"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/event/price/PriceModelHandler.php#L68-L87 |
lovata/oc-shopaholic-plugin | models/PromoBlock.php | PromoBlock.getTypeList | public static function getTypeList() : array
{
$arResult = [
self::PROMO_BLOCK_TYPE => Lang::get('lovata.shopaholic::lang.field.promo_block_type'),
];
$arEventDataList = Event::fire(self::EVENT_GET_TYPE_LIST);
if (empty($arEventDataList)) {
return $arResult;
... | php | public static function getTypeList() : array
{
$arResult = [
self::PROMO_BLOCK_TYPE => Lang::get('lovata.shopaholic::lang.field.promo_block_type'),
];
$arEventDataList = Event::fire(self::EVENT_GET_TYPE_LIST);
if (empty($arEventDataList)) {
return $arResult;
... | [
"public",
"static",
"function",
"getTypeList",
"(",
")",
":",
"array",
"{",
"$",
"arResult",
"=",
"[",
"self",
"::",
"PROMO_BLOCK_TYPE",
"=>",
"Lang",
"::",
"get",
"(",
"'lovata.shopaholic::lang.field.promo_block_type'",
")",
",",
"]",
";",
"$",
"arEventDataList... | Fire event and get promo content type list
@return array | [
"Fire",
"event",
"and",
"get",
"promo",
"content",
"type",
"list"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/models/PromoBlock.php#L157-L177 |
lovata/oc-shopaholic-plugin | classes/console/CheckTableIntegrity.php | CheckTableIntegrity.handle | public function handle()
{
foreach ($this->arMigrationList as $arMigrationData) {
$sClassName = $arMigrationData['class'];
$sFilePath = $arMigrationData['path'];
include_once base_path($sFilePath);
if (!class_exists($sClassName)) {
continue;
... | php | public function handle()
{
foreach ($this->arMigrationList as $arMigrationData) {
$sClassName = $arMigrationData['class'];
$sFilePath = $arMigrationData['path'];
include_once base_path($sFilePath);
if (!class_exists($sClassName)) {
continue;
... | [
"public",
"function",
"handle",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"arMigrationList",
"as",
"$",
"arMigrationData",
")",
"{",
"$",
"sClassName",
"=",
"$",
"arMigrationData",
"[",
"'class'",
"]",
";",
"$",
"sFilePath",
"=",
"$",
"arMigrationD... | Execute the console command.
@throws \Throwable | [
"Execute",
"the",
"console",
"command",
"."
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/console/CheckTableIntegrity.php#L36-L51 |
lovata/oc-shopaholic-plugin | classes/helper/CategoryMenuType.php | CategoryMenuType.resolveMenuItem | public function resolveMenuItem($obMenuItem, $sURL)
{
$arResult = [];
if (empty($obMenuItem->reference)) {
return $arResult;
}
$obCategoryItem = CategoryItem::make($obMenuItem->reference);
if ($obCategoryItem->isEmpty()) {
return $arResult;
}... | php | public function resolveMenuItem($obMenuItem, $sURL)
{
$arResult = [];
if (empty($obMenuItem->reference)) {
return $arResult;
}
$obCategoryItem = CategoryItem::make($obMenuItem->reference);
if ($obCategoryItem->isEmpty()) {
return $arResult;
}... | [
"public",
"function",
"resolveMenuItem",
"(",
"$",
"obMenuItem",
",",
"$",
"sURL",
")",
"{",
"$",
"arResult",
"=",
"[",
"]",
";",
"if",
"(",
"empty",
"(",
"$",
"obMenuItem",
"->",
"reference",
")",
")",
"{",
"return",
"$",
"arResult",
";",
"}",
"$",
... | Handler for the pages.menuitem.resolveItem event.
@param \RainLab\Pages\Classes\MenuItem $obMenuItem
@param string $sURL
@return array|mixed | [
"Handler",
"for",
"the",
"pages",
".",
"menuitem",
".",
"resolveItem",
"event",
"."
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/helper/CategoryMenuType.php#L22-L43 |
lovata/oc-shopaholic-plugin | classes/helper/AllCategoriesMenuType.php | AllCategoriesMenuType.resolveMenuItem | public function resolveMenuItem($obMenuItem, $sURL)
{
$arResult = [
'items' => [],
];
//Get category list with sorted by 'nest_left'
$obCategoryList = Category::active()->orderBy('nest_left', 'asc')->get();
if ($obCategoryList->isEmpty()) {
return $ar... | php | public function resolveMenuItem($obMenuItem, $sURL)
{
$arResult = [
'items' => [],
];
//Get category list with sorted by 'nest_left'
$obCategoryList = Category::active()->orderBy('nest_left', 'asc')->get();
if ($obCategoryList->isEmpty()) {
return $ar... | [
"public",
"function",
"resolveMenuItem",
"(",
"$",
"obMenuItem",
",",
"$",
"sURL",
")",
"{",
"$",
"arResult",
"=",
"[",
"'items'",
"=>",
"[",
"]",
",",
"]",
";",
"//Get category list with sorted by 'nest_left'",
"$",
"obCategoryList",
"=",
"Category",
"::",
"a... | Handler for the pages.menuitem.resolveItem event.
@param \RainLab\Pages\Classes\MenuItem $obMenuItem
@param string $sURL
@return array|mixed | [
"Handler",
"for",
"the",
"pages",
".",
"menuitem",
".",
"resolveItem",
"event",
".",
"@param",
"\\",
"RainLab",
"\\",
"Pages",
"\\",
"Classes",
"\\",
"MenuItem",
"$obMenuItem",
"@param",
"string",
"$sURL"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/helper/AllCategoriesMenuType.php#L22-L43 |
lovata/oc-shopaholic-plugin | classes/store/ProductListStore.php | ProductListStore.init | protected function init()
{
$this->addToStoreList('sorting', SortingListStore::class);
$this->addToStoreList('category', ListByCategoryStore::class);
$this->addToStoreList('brand', ListByBrandStore::class);
$this->addToStoreList('active', ActiveListStore::class);
$this->addTo... | php | protected function init()
{
$this->addToStoreList('sorting', SortingListStore::class);
$this->addToStoreList('category', ListByCategoryStore::class);
$this->addToStoreList('brand', ListByBrandStore::class);
$this->addToStoreList('active', ActiveListStore::class);
$this->addTo... | [
"protected",
"function",
"init",
"(",
")",
"{",
"$",
"this",
"->",
"addToStoreList",
"(",
"'sorting'",
",",
"SortingListStore",
"::",
"class",
")",
";",
"$",
"this",
"->",
"addToStoreList",
"(",
"'category'",
",",
"ListByCategoryStore",
"::",
"class",
")",
"... | Init store method | [
"Init",
"store",
"method"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/store/ProductListStore.php#L37-L44 |
lovata/oc-shopaholic-plugin | classes/store/offer/SortingListStore.php | SortingListStore.getIDListFromDB | protected function getIDListFromDB() : array
{
if ($this->sValue == OfferListStore::SORT_PRICE_ASC) {
$arElementIDList = $this->getByPriceASC();
} elseif ($this->sValue == OfferListStore::SORT_PRICE_DESC) {
$arElementIDList = $this->getByPriceDESC();
... | php | protected function getIDListFromDB() : array
{
if ($this->sValue == OfferListStore::SORT_PRICE_ASC) {
$arElementIDList = $this->getByPriceASC();
} elseif ($this->sValue == OfferListStore::SORT_PRICE_DESC) {
$arElementIDList = $this->getByPriceDESC();
... | [
"protected",
"function",
"getIDListFromDB",
"(",
")",
":",
"array",
"{",
"if",
"(",
"$",
"this",
"->",
"sValue",
"==",
"OfferListStore",
"::",
"SORT_PRICE_ASC",
")",
"{",
"$",
"arElementIDList",
"=",
"$",
"this",
"->",
"getByPriceASC",
"(",
")",
";",
"}",
... | Get ID list from database
@return array | [
"Get",
"ID",
"list",
"from",
"database"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/store/offer/SortingListStore.php#L24-L43 |
lovata/oc-shopaholic-plugin | classes/store/offer/SortingListStore.php | SortingListStore.getCustomSortingList | protected function getCustomSortingList() : array
{
$arEventResult = Event::fire('shopaholic.sorting.offer.get.list', [$this->sValue]);
if (empty($arEventResult)) {
return [];
}
$arElementIDList = [];
foreach ($arEventResult as $arEventOfferIDList) {
... | php | protected function getCustomSortingList() : array
{
$arEventResult = Event::fire('shopaholic.sorting.offer.get.list', [$this->sValue]);
if (empty($arEventResult)) {
return [];
}
$arElementIDList = [];
foreach ($arEventResult as $arEventOfferIDList) {
... | [
"protected",
"function",
"getCustomSortingList",
"(",
")",
":",
"array",
"{",
"$",
"arEventResult",
"=",
"Event",
"::",
"fire",
"(",
"'shopaholic.sorting.offer.get.list'",
",",
"[",
"$",
"this",
"->",
"sValue",
"]",
")",
";",
"if",
"(",
"empty",
"(",
"$",
... | Get product list with custom sorting
@return array | [
"Get",
"product",
"list",
"with",
"custom",
"sorting"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/store/offer/SortingListStore.php#L49-L67 |
lovata/oc-shopaholic-plugin | classes/store/offer/SortingListStore.php | SortingListStore.getByPriceTypeASC | protected function getByPriceTypeASC() : array
{
$obPriceType = $this->getPriceTypeObject();
if (empty($obPriceType)) {
return $this->getByPriceASC();
}
$arElementIDList = (array) Price::getByItemType(Offer::class)
->getByPriceType($obPriceType->id)
... | php | protected function getByPriceTypeASC() : array
{
$obPriceType = $this->getPriceTypeObject();
if (empty($obPriceType)) {
return $this->getByPriceASC();
}
$arElementIDList = (array) Price::getByItemType(Offer::class)
->getByPriceType($obPriceType->id)
... | [
"protected",
"function",
"getByPriceTypeASC",
"(",
")",
":",
"array",
"{",
"$",
"obPriceType",
"=",
"$",
"this",
"->",
"getPriceTypeObject",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"obPriceType",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getByPri... | Get sorting ID list by offer price (ASC)
@return array | [
"Get",
"sorting",
"ID",
"list",
"by",
"offer",
"price",
"(",
"ASC",
")"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/store/offer/SortingListStore.php#L101-L114 |
lovata/oc-shopaholic-plugin | classes/store/offer/SortingListStore.php | SortingListStore.getByPriceTypeDESC | protected function getByPriceTypeDESC() : array
{
$obPriceType = $this->getPriceTypeObject();
if (empty($obPriceType)) {
return $this->getByPriceDESC();
}
$arElementIDList = (array) Price::getByItemType(Offer::class)
->getByPriceType($obPriceType->id)
... | php | protected function getByPriceTypeDESC() : array
{
$obPriceType = $this->getPriceTypeObject();
if (empty($obPriceType)) {
return $this->getByPriceDESC();
}
$arElementIDList = (array) Price::getByItemType(Offer::class)
->getByPriceType($obPriceType->id)
... | [
"protected",
"function",
"getByPriceTypeDESC",
"(",
")",
":",
"array",
"{",
"$",
"obPriceType",
"=",
"$",
"this",
"->",
"getPriceTypeObject",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"obPriceType",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getByPr... | Get sorting ID list by offer price (DESC)
@return array | [
"Get",
"sorting",
"ID",
"list",
"by",
"offer",
"price",
"(",
"DESC",
")"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/store/offer/SortingListStore.php#L120-L133 |
lovata/oc-shopaholic-plugin | classes/store/offer/SortingListStore.php | SortingListStore.getPriceTypeObject | protected function getPriceTypeObject()
{
$arValuePartList = explode('|', $this->sValue);
$sPriceTypeCode = array_pop($arValuePartList);
$obPriceType = PriceTypeHelper::instance()->findByCode($sPriceTypeCode);
return $obPriceType;
} | php | protected function getPriceTypeObject()
{
$arValuePartList = explode('|', $this->sValue);
$sPriceTypeCode = array_pop($arValuePartList);
$obPriceType = PriceTypeHelper::instance()->findByCode($sPriceTypeCode);
return $obPriceType;
} | [
"protected",
"function",
"getPriceTypeObject",
"(",
")",
"{",
"$",
"arValuePartList",
"=",
"explode",
"(",
"'|'",
",",
"$",
"this",
"->",
"sValue",
")",
";",
"$",
"sPriceTypeCode",
"=",
"array_pop",
"(",
"$",
"arValuePartList",
")",
";",
"$",
"obPriceType",
... | Get price type object
@return \Lovata\Shopaholic\Models\PriceType | [
"Get",
"price",
"type",
"object"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/store/offer/SortingListStore.php#L161-L169 |
lovata/oc-shopaholic-plugin | classes/item/PromoBlockItem.php | PromoBlockItem.getPageUrl | public function getPageUrl($sPageCode = 'promo-block')
{
//Get URL params
$arParamList = $this->getPageParamList($sPageCode);
//Generate page URL
$sURL = CmsPage::url($sPageCode, $arParamList);
return $sURL;
} | php | public function getPageUrl($sPageCode = 'promo-block')
{
//Get URL params
$arParamList = $this->getPageParamList($sPageCode);
//Generate page URL
$sURL = CmsPage::url($sPageCode, $arParamList);
return $sURL;
} | [
"public",
"function",
"getPageUrl",
"(",
"$",
"sPageCode",
"=",
"'promo-block'",
")",
"{",
"//Get URL params",
"$",
"arParamList",
"=",
"$",
"this",
"->",
"getPageParamList",
"(",
"$",
"sPageCode",
")",
";",
"//Generate page URL",
"$",
"sURL",
"=",
"CmsPage",
... | Returns URL of a promo block page.
@param string $sPageCode
@return string | [
"Returns",
"URL",
"of",
"a",
"promo",
"block",
"page",
"."
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/item/PromoBlockItem.php#L55-L64 |
lovata/oc-shopaholic-plugin | classes/item/PromoBlockItem.php | PromoBlockItem.getPageParamList | public function getPageParamList($sPageCode) : array
{
$arPageParamList = [];
//Get URL params for page
$arParamList = PageHelper::instance()->getUrlParamList($sPageCode, 'PromoBlockPage');
if (!empty($arParamList)) {
$sPageParam = array_shift($arParamList);
... | php | public function getPageParamList($sPageCode) : array
{
$arPageParamList = [];
//Get URL params for page
$arParamList = PageHelper::instance()->getUrlParamList($sPageCode, 'PromoBlockPage');
if (!empty($arParamList)) {
$sPageParam = array_shift($arParamList);
... | [
"public",
"function",
"getPageParamList",
"(",
"$",
"sPageCode",
")",
":",
"array",
"{",
"$",
"arPageParamList",
"=",
"[",
"]",
";",
"//Get URL params for page",
"$",
"arParamList",
"=",
"PageHelper",
"::",
"instance",
"(",
")",
"->",
"getUrlParamList",
"(",
"... | Get URL param list by page code
@param string $sPageCode
@return array | [
"Get",
"URL",
"param",
"list",
"by",
"page",
"code"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/item/PromoBlockItem.php#L71-L83 |
lovata/oc-shopaholic-plugin | classes/collection/BrandCollection.php | BrandCollection.category | public function category($iCategoryID)
{
$arResultIDList = BrandListStore::instance()->category->get($iCategoryID);
return $this->intersect($arResultIDList);
} | php | public function category($iCategoryID)
{
$arResultIDList = BrandListStore::instance()->category->get($iCategoryID);
return $this->intersect($arResultIDList);
} | [
"public",
"function",
"category",
"(",
"$",
"iCategoryID",
")",
"{",
"$",
"arResultIDList",
"=",
"BrandListStore",
"::",
"instance",
"(",
")",
"->",
"category",
"->",
"get",
"(",
"$",
"iCategoryID",
")",
";",
"return",
"$",
"this",
"->",
"intersect",
"(",
... | Filter brand list by category ID
@param int $iCategoryID
@return $this | [
"Filter",
"brand",
"list",
"by",
"category",
"ID"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/collection/BrandCollection.php#L48-L53 |
lovata/oc-shopaholic-plugin | classes/helper/CurrencyHelper.php | CurrencyHelper.disableActiveCurrency | public function disableActiveCurrency()
{
if (empty($this->obDefaultCurrency)) {
return;
}
$this->sActiveCurrencyCode = $this->obDefaultCurrency->code;
$this->obActiveCurrency = $this->obDefaultCurrency;
} | php | public function disableActiveCurrency()
{
if (empty($this->obDefaultCurrency)) {
return;
}
$this->sActiveCurrencyCode = $this->obDefaultCurrency->code;
$this->obActiveCurrency = $this->obDefaultCurrency;
} | [
"public",
"function",
"disableActiveCurrency",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"obDefaultCurrency",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"sActiveCurrencyCode",
"=",
"$",
"this",
"->",
"obDefaultCurrency",
"->",
"... | Set default currency as active
Used in backend | [
"Set",
"default",
"currency",
"as",
"active",
"Used",
"in",
"backend"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/helper/CurrencyHelper.php#L56-L64 |
lovata/oc-shopaholic-plugin | classes/helper/CurrencyHelper.php | CurrencyHelper.getCurrencySymbol | public function getCurrencySymbol($sCurrencyCode)
{
$obCurrency = $this->obCurrencyList->where('code', $sCurrencyCode)->first();
if (empty($obCurrency)) {
return null;
}
return $obCurrency->symbol;
} | php | public function getCurrencySymbol($sCurrencyCode)
{
$obCurrency = $this->obCurrencyList->where('code', $sCurrencyCode)->first();
if (empty($obCurrency)) {
return null;
}
return $obCurrency->symbol;
} | [
"public",
"function",
"getCurrencySymbol",
"(",
"$",
"sCurrencyCode",
")",
"{",
"$",
"obCurrency",
"=",
"$",
"this",
"->",
"obCurrencyList",
"->",
"where",
"(",
"'code'",
",",
"$",
"sCurrencyCode",
")",
"->",
"first",
"(",
")",
";",
"if",
"(",
"empty",
"... | Get currency symbol
@param string $sCurrencyCode
@return null|string | [
"Get",
"currency",
"symbol"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/helper/CurrencyHelper.php#L99-L107 |
lovata/oc-shopaholic-plugin | classes/helper/CurrencyHelper.php | CurrencyHelper.getCurrencyCode | public function getCurrencyCode($sCurrencyCode)
{
$obCurrency = $this->obCurrencyList->where('code', $sCurrencyCode)->first();
if (empty($obCurrency)) {
return null;
}
return $obCurrency->code;
} | php | public function getCurrencyCode($sCurrencyCode)
{
$obCurrency = $this->obCurrencyList->where('code', $sCurrencyCode)->first();
if (empty($obCurrency)) {
return null;
}
return $obCurrency->code;
} | [
"public",
"function",
"getCurrencyCode",
"(",
"$",
"sCurrencyCode",
")",
"{",
"$",
"obCurrency",
"=",
"$",
"this",
"->",
"obCurrencyList",
"->",
"where",
"(",
"'code'",
",",
"$",
"sCurrencyCode",
")",
"->",
"first",
"(",
")",
";",
"if",
"(",
"empty",
"("... | Get currency code
@param string $sCurrencyCode
@return null|string | [
"Get",
"currency",
"code"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/helper/CurrencyHelper.php#L114-L122 |
lovata/oc-shopaholic-plugin | classes/helper/CurrencyHelper.php | CurrencyHelper.switchActive | public function switchActive($sCurrencyCode)
{
$obUserStorage = $this->getUserStorage();
$obUserStorage->put(self::FIELD_NAME, $sCurrencyCode);
$this->sActiveCurrencyCode = $sCurrencyCode;
$this->initActiveCurrency();
} | php | public function switchActive($sCurrencyCode)
{
$obUserStorage = $this->getUserStorage();
$obUserStorage->put(self::FIELD_NAME, $sCurrencyCode);
$this->sActiveCurrencyCode = $sCurrencyCode;
$this->initActiveCurrency();
} | [
"public",
"function",
"switchActive",
"(",
"$",
"sCurrencyCode",
")",
"{",
"$",
"obUserStorage",
"=",
"$",
"this",
"->",
"getUserStorage",
"(",
")",
";",
"$",
"obUserStorage",
"->",
"put",
"(",
"self",
"::",
"FIELD_NAME",
",",
"$",
"sCurrencyCode",
")",
";... | Clear active currency value
@param string $sCurrencyCode | [
"Clear",
"active",
"currency",
"value"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/helper/CurrencyHelper.php#L128-L135 |
lovata/oc-shopaholic-plugin | classes/helper/CurrencyHelper.php | CurrencyHelper.resetActive | public function resetActive()
{
$obUserStorage = $this->getUserStorage();
$obUserStorage->clear(self::FIELD_NAME);
$this->obActiveCurrency = $this->obDefaultCurrency;
} | php | public function resetActive()
{
$obUserStorage = $this->getUserStorage();
$obUserStorage->clear(self::FIELD_NAME);
$this->obActiveCurrency = $this->obDefaultCurrency;
} | [
"public",
"function",
"resetActive",
"(",
")",
"{",
"$",
"obUserStorage",
"=",
"$",
"this",
"->",
"getUserStorage",
"(",
")",
";",
"$",
"obUserStorage",
"->",
"clear",
"(",
"self",
"::",
"FIELD_NAME",
")",
";",
"$",
"this",
"->",
"obActiveCurrency",
"=",
... | Clear active currency value | [
"Clear",
"active",
"currency",
"value"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/helper/CurrencyHelper.php#L140-L146 |
lovata/oc-shopaholic-plugin | classes/helper/CurrencyHelper.php | CurrencyHelper.init | protected function init()
{
$this->obCurrencyList = Currency::active()->get();
$this->obDefaultCurrency = $this->obCurrencyList->where('is_default', true)->first();
$this->sActiveCurrencyCode = $this->getActiveCurrencyFromStorage();
$this->initActiveCurrency();
} | php | protected function init()
{
$this->obCurrencyList = Currency::active()->get();
$this->obDefaultCurrency = $this->obCurrencyList->where('is_default', true)->first();
$this->sActiveCurrencyCode = $this->getActiveCurrencyFromStorage();
$this->initActiveCurrency();
} | [
"protected",
"function",
"init",
"(",
")",
"{",
"$",
"this",
"->",
"obCurrencyList",
"=",
"Currency",
"::",
"active",
"(",
")",
"->",
"get",
"(",
")",
";",
"$",
"this",
"->",
"obDefaultCurrency",
"=",
"$",
"this",
"->",
"obCurrencyList",
"->",
"where",
... | Init currency data | [
"Init",
"currency",
"data"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/helper/CurrencyHelper.php#L173-L180 |
lovata/oc-shopaholic-plugin | classes/helper/CurrencyHelper.php | CurrencyHelper.initActiveCurrency | protected function initActiveCurrency()
{
$this->obActiveCurrency = null;
if (!empty($this->sActiveCurrencyCode)) {
$this->obActiveCurrency = $this->obCurrencyList->where('code', $this->sActiveCurrencyCode)->first();
}
if (empty($this->obActiveCurrency)) {
$t... | php | protected function initActiveCurrency()
{
$this->obActiveCurrency = null;
if (!empty($this->sActiveCurrencyCode)) {
$this->obActiveCurrency = $this->obCurrencyList->where('code', $this->sActiveCurrencyCode)->first();
}
if (empty($this->obActiveCurrency)) {
$t... | [
"protected",
"function",
"initActiveCurrency",
"(",
")",
"{",
"$",
"this",
"->",
"obActiveCurrency",
"=",
"null",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"sActiveCurrencyCode",
")",
")",
"{",
"$",
"this",
"->",
"obActiveCurrency",
"=",
"$",
... | Get active currency code and find active currency object by code | [
"Get",
"active",
"currency",
"code",
"and",
"find",
"active",
"currency",
"object",
"by",
"code"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/helper/CurrencyHelper.php#L185-L195 |
lovata/oc-shopaholic-plugin | classes/helper/CurrencyHelper.php | CurrencyHelper.getActiveCurrencyFromStorage | protected function getActiveCurrencyFromStorage()
{
$obUserStorage = $this->getUserStorage();
$sActiveCurrencyCode = $obUserStorage->get(self::FIELD_NAME);
return $sActiveCurrencyCode;
} | php | protected function getActiveCurrencyFromStorage()
{
$obUserStorage = $this->getUserStorage();
$sActiveCurrencyCode = $obUserStorage->get(self::FIELD_NAME);
return $sActiveCurrencyCode;
} | [
"protected",
"function",
"getActiveCurrencyFromStorage",
"(",
")",
"{",
"$",
"obUserStorage",
"=",
"$",
"this",
"->",
"getUserStorage",
"(",
")",
";",
"$",
"sActiveCurrencyCode",
"=",
"$",
"obUserStorage",
"->",
"get",
"(",
"self",
"::",
"FIELD_NAME",
")",
";"... | Get active currency code from user storage
@return array | [
"Get",
"active",
"currency",
"code",
"from",
"user",
"storage"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/helper/CurrencyHelper.php#L201-L207 |
lovata/oc-shopaholic-plugin | classes/item/OfferItem.php | OfferItem.getPriceValueAttribute | protected function getPriceValueAttribute()
{
if (empty($this->iActivePriceType)) {
$fPrice = $this->getAttribute('price_value');
} else {
$fPrice = array_get($this->price_list, $this->iActivePriceType.'.price');
}
$fPrice = CurrencyHelper::instance()->conver... | php | protected function getPriceValueAttribute()
{
if (empty($this->iActivePriceType)) {
$fPrice = $this->getAttribute('price_value');
} else {
$fPrice = array_get($this->price_list, $this->iActivePriceType.'.price');
}
$fPrice = CurrencyHelper::instance()->conver... | [
"protected",
"function",
"getPriceValueAttribute",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"iActivePriceType",
")",
")",
"{",
"$",
"fPrice",
"=",
"$",
"this",
"->",
"getAttribute",
"(",
"'price_value'",
")",
";",
"}",
"else",
"{",
"$",... | Get price_value attribute
@return float | [
"Get",
"price_value",
"attribute"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/item/OfferItem.php#L177-L188 |
lovata/oc-shopaholic-plugin | classes/item/OfferItem.php | OfferItem.getDiscountPriceValueAttribute | protected function getDiscountPriceValueAttribute()
{
$fOldPrice = $this->old_price_value;
$fPrice = $this->price_value;
$fDiscountPrice = 0;
if ($fOldPrice > 0) {
$fDiscountPrice = PriceHelper::round($fOldPrice - $fPrice);
}
$fPrice = CurrencyHelper::in... | php | protected function getDiscountPriceValueAttribute()
{
$fOldPrice = $this->old_price_value;
$fPrice = $this->price_value;
$fDiscountPrice = 0;
if ($fOldPrice > 0) {
$fDiscountPrice = PriceHelper::round($fOldPrice - $fPrice);
}
$fPrice = CurrencyHelper::in... | [
"protected",
"function",
"getDiscountPriceValueAttribute",
"(",
")",
"{",
"$",
"fOldPrice",
"=",
"$",
"this",
"->",
"old_price_value",
";",
"$",
"fPrice",
"=",
"$",
"this",
"->",
"price_value",
";",
"$",
"fDiscountPrice",
"=",
"0",
";",
"if",
"(",
"$",
"fO... | Get discount_price_value attribute
@return float | [
"Get",
"discount_price_value",
"attribute"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/item/OfferItem.php#L211-L224 |
lovata/oc-shopaholic-plugin | classes/item/OfferItem.php | OfferItem.getCurrencyAttribute | protected function getCurrencyAttribute()
{
if (empty($this->sActiveCurrency)) {
return CurrencyHelper::instance()->getActiveCurrencySymbol();
}
$sResult = CurrencyHelper::instance()->getCurrencySymbol($this->sActiveCurrency);
$this->sActiveCurrency = null;
retu... | php | protected function getCurrencyAttribute()
{
if (empty($this->sActiveCurrency)) {
return CurrencyHelper::instance()->getActiveCurrencySymbol();
}
$sResult = CurrencyHelper::instance()->getCurrencySymbol($this->sActiveCurrency);
$this->sActiveCurrency = null;
retu... | [
"protected",
"function",
"getCurrencyAttribute",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"sActiveCurrency",
")",
")",
"{",
"return",
"CurrencyHelper",
"::",
"instance",
"(",
")",
"->",
"getActiveCurrencySymbol",
"(",
")",
";",
"}",
"$",
... | Get currency value
@return null|string | [
"Get",
"currency",
"value"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/item/OfferItem.php#L230-L240 |
lovata/oc-shopaholic-plugin | classes/item/OfferItem.php | OfferItem.getCurrencyCodeAttribute | protected function getCurrencyCodeAttribute()
{
if (empty($this->sActiveCurrency)) {
return CurrencyHelper::instance()->getActiveCurrencyCode();
}
$sResult = CurrencyHelper::instance()->getCurrencyCode($this->sActiveCurrency);
$this->sActiveCurrency = null;
retu... | php | protected function getCurrencyCodeAttribute()
{
if (empty($this->sActiveCurrency)) {
return CurrencyHelper::instance()->getActiveCurrencyCode();
}
$sResult = CurrencyHelper::instance()->getCurrencyCode($this->sActiveCurrency);
$this->sActiveCurrency = null;
retu... | [
"protected",
"function",
"getCurrencyCodeAttribute",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"sActiveCurrency",
")",
")",
"{",
"return",
"CurrencyHelper",
"::",
"instance",
"(",
")",
"->",
"getActiveCurrencyCode",
"(",
")",
";",
"}",
"$",
... | Get currency code value
@return null|string | [
"Get",
"currency",
"code",
"value"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/item/OfferItem.php#L246-L256 |
lovata/oc-shopaholic-plugin | classes/item/OfferItem.php | OfferItem.getPriceWithTaxValueAttribute | protected function getPriceWithTaxValueAttribute()
{
$fPrice = TaxHelper::instance()->getPriceWithTax($this->price_value, $this->tax_percent);
return $fPrice;
} | php | protected function getPriceWithTaxValueAttribute()
{
$fPrice = TaxHelper::instance()->getPriceWithTax($this->price_value, $this->tax_percent);
return $fPrice;
} | [
"protected",
"function",
"getPriceWithTaxValueAttribute",
"(",
")",
"{",
"$",
"fPrice",
"=",
"TaxHelper",
"::",
"instance",
"(",
")",
"->",
"getPriceWithTax",
"(",
"$",
"this",
"->",
"price_value",
",",
"$",
"this",
"->",
"tax_percent",
")",
";",
"return",
"... | Get price_with_tax_value attribute value
@return float | [
"Get",
"price_with_tax_value",
"attribute",
"value"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/item/OfferItem.php#L295-L300 |
lovata/oc-shopaholic-plugin | classes/item/OfferItem.php | OfferItem.getOldPriceWithTaxValueAttribute | protected function getOldPriceWithTaxValueAttribute()
{
$fPrice = TaxHelper::instance()->getPriceWithTax($this->old_price_value, $this->tax_percent);
return $fPrice;
} | php | protected function getOldPriceWithTaxValueAttribute()
{
$fPrice = TaxHelper::instance()->getPriceWithTax($this->old_price_value, $this->tax_percent);
return $fPrice;
} | [
"protected",
"function",
"getOldPriceWithTaxValueAttribute",
"(",
")",
"{",
"$",
"fPrice",
"=",
"TaxHelper",
"::",
"instance",
"(",
")",
"->",
"getPriceWithTax",
"(",
"$",
"this",
"->",
"old_price_value",
",",
"$",
"this",
"->",
"tax_percent",
")",
";",
"retur... | Get old_price_with_tax_value attribute value
@return float | [
"Get",
"old_price_with_tax_value",
"attribute",
"value"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/item/OfferItem.php#L306-L311 |
lovata/oc-shopaholic-plugin | classes/item/OfferItem.php | OfferItem.getDiscountPriceWithTaxValueAttribute | protected function getDiscountPriceWithTaxValueAttribute()
{
$fPrice = TaxHelper::instance()->getPriceWithTax($this->discount_price_value, $this->tax_percent);
return $fPrice;
} | php | protected function getDiscountPriceWithTaxValueAttribute()
{
$fPrice = TaxHelper::instance()->getPriceWithTax($this->discount_price_value, $this->tax_percent);
return $fPrice;
} | [
"protected",
"function",
"getDiscountPriceWithTaxValueAttribute",
"(",
")",
"{",
"$",
"fPrice",
"=",
"TaxHelper",
"::",
"instance",
"(",
")",
"->",
"getPriceWithTax",
"(",
"$",
"this",
"->",
"discount_price_value",
",",
"$",
"this",
"->",
"tax_percent",
")",
";"... | Get discount_price_with_tax_value attribute value
@return float | [
"Get",
"discount_price_with_tax_value",
"attribute",
"value"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/item/OfferItem.php#L317-L322 |
lovata/oc-shopaholic-plugin | classes/item/OfferItem.php | OfferItem.getPriceWithoutTaxValueAttribute | protected function getPriceWithoutTaxValueAttribute()
{
$fPrice = TaxHelper::instance()->getPriceWithoutTax($this->price_value, $this->tax_percent);
return $fPrice;
} | php | protected function getPriceWithoutTaxValueAttribute()
{
$fPrice = TaxHelper::instance()->getPriceWithoutTax($this->price_value, $this->tax_percent);
return $fPrice;
} | [
"protected",
"function",
"getPriceWithoutTaxValueAttribute",
"(",
")",
"{",
"$",
"fPrice",
"=",
"TaxHelper",
"::",
"instance",
"(",
")",
"->",
"getPriceWithoutTax",
"(",
"$",
"this",
"->",
"price_value",
",",
"$",
"this",
"->",
"tax_percent",
")",
";",
"return... | Get price_without_tax_value attribute value
@return float | [
"Get",
"price_without_tax_value",
"attribute",
"value"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/item/OfferItem.php#L328-L333 |
lovata/oc-shopaholic-plugin | classes/item/OfferItem.php | OfferItem.getOldPriceWithoutTaxValueAttribute | protected function getOldPriceWithoutTaxValueAttribute()
{
$fPrice = TaxHelper::instance()->getPriceWithoutTax($this->old_price_value, $this->tax_percent);
return $fPrice;
} | php | protected function getOldPriceWithoutTaxValueAttribute()
{
$fPrice = TaxHelper::instance()->getPriceWithoutTax($this->old_price_value, $this->tax_percent);
return $fPrice;
} | [
"protected",
"function",
"getOldPriceWithoutTaxValueAttribute",
"(",
")",
"{",
"$",
"fPrice",
"=",
"TaxHelper",
"::",
"instance",
"(",
")",
"->",
"getPriceWithoutTax",
"(",
"$",
"this",
"->",
"old_price_value",
",",
"$",
"this",
"->",
"tax_percent",
")",
";",
... | Get old_price_without_tax_value attribute value
@return float | [
"Get",
"old_price_without_tax_value",
"attribute",
"value"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/item/OfferItem.php#L339-L344 |
lovata/oc-shopaholic-plugin | classes/item/OfferItem.php | OfferItem.getDiscountPriceWithoutTaxValueAttribute | protected function getDiscountPriceWithoutTaxValueAttribute()
{
$fPrice = TaxHelper::instance()->getPriceWithoutTax($this->discount_price_value, $this->tax_percent);
return $fPrice;
} | php | protected function getDiscountPriceWithoutTaxValueAttribute()
{
$fPrice = TaxHelper::instance()->getPriceWithoutTax($this->discount_price_value, $this->tax_percent);
return $fPrice;
} | [
"protected",
"function",
"getDiscountPriceWithoutTaxValueAttribute",
"(",
")",
"{",
"$",
"fPrice",
"=",
"TaxHelper",
"::",
"instance",
"(",
")",
"->",
"getPriceWithoutTax",
"(",
"$",
"this",
"->",
"discount_price_value",
",",
"$",
"this",
"->",
"tax_percent",
")",... | Get discount_price_without_tax_value attribute value
@return float | [
"Get",
"discount_price_without_tax_value",
"attribute",
"value"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/item/OfferItem.php#L350-L355 |
lovata/oc-shopaholic-plugin | classes/item/OfferItem.php | OfferItem.getTaxPercentAttribute | protected function getTaxPercentAttribute()
{
$fTaxPercent = $this->getAttribute('tax_percent');
if ($fTaxPercent === null) {
$fTaxPercent = TaxHelper::instance()->getTaxPercent($this->tax_list);
$this->setAttribute('tax_percent', $fTaxPercent);
}
return $fTa... | php | protected function getTaxPercentAttribute()
{
$fTaxPercent = $this->getAttribute('tax_percent');
if ($fTaxPercent === null) {
$fTaxPercent = TaxHelper::instance()->getTaxPercent($this->tax_list);
$this->setAttribute('tax_percent', $fTaxPercent);
}
return $fTa... | [
"protected",
"function",
"getTaxPercentAttribute",
"(",
")",
"{",
"$",
"fTaxPercent",
"=",
"$",
"this",
"->",
"getAttribute",
"(",
"'tax_percent'",
")",
";",
"if",
"(",
"$",
"fTaxPercent",
"===",
"null",
")",
"{",
"$",
"fTaxPercent",
"=",
"TaxHelper",
"::",
... | Get tax_percent attribute value
@return float | [
"Get",
"tax_percent",
"attribute",
"value"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/item/OfferItem.php#L361-L370 |
lovata/oc-shopaholic-plugin | classes/item/OfferItem.php | OfferItem.getTaxListAttribute | protected function getTaxListAttribute()
{
$obTaxList = $this->getAttribute('tax_list');
if ($obTaxList === null) {
$obTaxList = $this->getAppliedTaxList();
$this->setAttribute('tax_list', $obTaxList);
}
return $obTaxList;
} | php | protected function getTaxListAttribute()
{
$obTaxList = $this->getAttribute('tax_list');
if ($obTaxList === null) {
$obTaxList = $this->getAppliedTaxList();
$this->setAttribute('tax_list', $obTaxList);
}
return $obTaxList;
} | [
"protected",
"function",
"getTaxListAttribute",
"(",
")",
"{",
"$",
"obTaxList",
"=",
"$",
"this",
"->",
"getAttribute",
"(",
"'tax_list'",
")",
";",
"if",
"(",
"$",
"obTaxList",
"===",
"null",
")",
"{",
"$",
"obTaxList",
"=",
"$",
"this",
"->",
"getAppl... | Get tax_list attribute value
@return \Lovata\Shopaholic\Classes\Collection\TaxCollection|TaxItem[] | [
"Get",
"tax_list",
"attribute",
"value"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/item/OfferItem.php#L376-L385 |
lovata/oc-shopaholic-plugin | classes/item/OfferItem.php | OfferItem.getAppliedTaxList | protected function getAppliedTaxList()
{
$obResultTaxList = TaxHelper::instance()->getTaxList();
if ($obResultTaxList->isEmpty()) {
return $obResultTaxList;
}
foreach ($obResultTaxList as $obTaxItem) {
$bSkipTax = !$obTaxItem->is_global
&& !$o... | php | protected function getAppliedTaxList()
{
$obResultTaxList = TaxHelper::instance()->getTaxList();
if ($obResultTaxList->isEmpty()) {
return $obResultTaxList;
}
foreach ($obResultTaxList as $obTaxItem) {
$bSkipTax = !$obTaxItem->is_global
&& !$o... | [
"protected",
"function",
"getAppliedTaxList",
"(",
")",
"{",
"$",
"obResultTaxList",
"=",
"TaxHelper",
"::",
"instance",
"(",
")",
"->",
"getTaxList",
"(",
")",
";",
"if",
"(",
"$",
"obResultTaxList",
"->",
"isEmpty",
"(",
")",
")",
"{",
"return",
"$",
"... | Get applied tax list
@return \Lovata\Shopaholic\Classes\Collection\TaxCollection|\Lovata\Shopaholic\Classes\Item\TaxItem[] | [
"Get",
"applied",
"tax",
"list"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/item/OfferItem.php#L391-L411 |
lovata/oc-shopaholic-plugin | classes/item/OfferItem.php | OfferItem.getElementData | protected function getElementData()
{
$obDefaultCurrency = CurrencyHelper::instance()->getDefault();
$sCurrencyCode = !empty($obDefaultCurrency) ? $obDefaultCurrency->code : null;
$arResult = [
'price_value' => $this->obElement->setActiveCurrency($sCurrencyCode)->setActivePr... | php | protected function getElementData()
{
$obDefaultCurrency = CurrencyHelper::instance()->getDefault();
$sCurrencyCode = !empty($obDefaultCurrency) ? $obDefaultCurrency->code : null;
$arResult = [
'price_value' => $this->obElement->setActiveCurrency($sCurrencyCode)->setActivePr... | [
"protected",
"function",
"getElementData",
"(",
")",
"{",
"$",
"obDefaultCurrency",
"=",
"CurrencyHelper",
"::",
"instance",
"(",
")",
"->",
"getDefault",
"(",
")",
";",
"$",
"sCurrencyCode",
"=",
"!",
"empty",
"(",
"$",
"obDefaultCurrency",
")",
"?",
"$",
... | Set element data from model object
@return array | [
"Set",
"element",
"data",
"from",
"model",
"object"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/classes/item/OfferItem.php#L418-L430 |
lovata/oc-shopaholic-plugin | models/Offer.php | Offer.getPriceObject | public function getPriceObject($iPriceTypeID = null)
{
if (empty($iPriceTypeID)) {
$obPriceModel = $this->main_price;
} else {
$obPriceModel = $this->price_link->where('price_type_id', $iPriceTypeID)->first();
}
return $obPriceModel;
} | php | public function getPriceObject($iPriceTypeID = null)
{
if (empty($iPriceTypeID)) {
$obPriceModel = $this->main_price;
} else {
$obPriceModel = $this->price_link->where('price_type_id', $iPriceTypeID)->first();
}
return $obPriceModel;
} | [
"public",
"function",
"getPriceObject",
"(",
"$",
"iPriceTypeID",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"iPriceTypeID",
")",
")",
"{",
"$",
"obPriceModel",
"=",
"$",
"this",
"->",
"main_price",
";",
"}",
"else",
"{",
"$",
"obPriceModel",
... | Get price object
@param int $iPriceTypeID
@return \Illuminate\Database\Eloquent\Model|Price|null | [
"Get",
"price",
"object"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/models/Offer.php#L222-L231 |
lovata/oc-shopaholic-plugin | models/Offer.php | Offer.afterSave | public function afterSave()
{
$this->savePriceValue(null, $this->fSavedPrice, $this->fSavedOldPrice);
$this->savePriceListValue();
} | php | public function afterSave()
{
$this->savePriceValue(null, $this->fSavedPrice, $this->fSavedOldPrice);
$this->savePriceListValue();
} | [
"public",
"function",
"afterSave",
"(",
")",
"{",
"$",
"this",
"->",
"savePriceValue",
"(",
"null",
",",
"$",
"this",
"->",
"fSavedPrice",
",",
"$",
"this",
"->",
"fSavedOldPrice",
")",
";",
"$",
"this",
"->",
"savePriceListValue",
"(",
")",
";",
"}"
] | After save model event | [
"After",
"save",
"model",
"event"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/models/Offer.php#L236-L240 |
lovata/oc-shopaholic-plugin | models/Offer.php | Offer.setQuantityAttribute | public function setQuantityAttribute($iQuantity)
{
$iQuantity = (int) $iQuantity;
if (empty($iQuantity) || $iQuantity < 0) {
$iQuantity = 0;
}
$this->attributes['quantity'] = $iQuantity;
} | php | public function setQuantityAttribute($iQuantity)
{
$iQuantity = (int) $iQuantity;
if (empty($iQuantity) || $iQuantity < 0) {
$iQuantity = 0;
}
$this->attributes['quantity'] = $iQuantity;
} | [
"public",
"function",
"setQuantityAttribute",
"(",
"$",
"iQuantity",
")",
"{",
"$",
"iQuantity",
"=",
"(",
"int",
")",
"$",
"iQuantity",
";",
"if",
"(",
"empty",
"(",
"$",
"iQuantity",
")",
"||",
"$",
"iQuantity",
"<",
"0",
")",
"{",
"$",
"iQuantity",
... | Set quantity attribute value
@param int $iQuantity | [
"Set",
"quantity",
"attribute",
"value"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/models/Offer.php#L246-L254 |
lovata/oc-shopaholic-plugin | models/Offer.php | Offer.scopeGetByQuantity | public function scopeGetByQuantity($obQuery, $sData, $sCondition = '=')
{
if (empty($sData)) {
$sData = 0;
}
if (!empty($sCondition)) {
$obQuery->where('quantity', $sCondition, $sData);
}
return $obQuery;
} | php | public function scopeGetByQuantity($obQuery, $sData, $sCondition = '=')
{
if (empty($sData)) {
$sData = 0;
}
if (!empty($sCondition)) {
$obQuery->where('quantity', $sCondition, $sData);
}
return $obQuery;
} | [
"public",
"function",
"scopeGetByQuantity",
"(",
"$",
"obQuery",
",",
"$",
"sData",
",",
"$",
"sCondition",
"=",
"'='",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"sData",
")",
")",
"{",
"$",
"sData",
"=",
"0",
";",
"}",
"if",
"(",
"!",
"empty",
"("... | Get by quantity
@param Offer $obQuery
@param string $sData
@param string $sCondition
@return Offer | [
"Get",
"by",
"quantity",
"@param",
"Offer",
"$obQuery",
"@param",
"string",
"$sData",
"@param",
"string",
"$sCondition"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/models/Offer.php#L280-L291 |
lovata/oc-shopaholic-plugin | models/Offer.php | Offer.getPriceValueAttribute | protected function getPriceValueAttribute()
{
$obPriceModel = $this->getPriceObject($this->getActivePriceType());
$this->setActivePriceType(null);
if (empty($obPriceModel)) {
return 0;
}
$fPrice = $obPriceModel->price_value;
$fPrice = CurrencyHelper::ins... | php | protected function getPriceValueAttribute()
{
$obPriceModel = $this->getPriceObject($this->getActivePriceType());
$this->setActivePriceType(null);
if (empty($obPriceModel)) {
return 0;
}
$fPrice = $obPriceModel->price_value;
$fPrice = CurrencyHelper::ins... | [
"protected",
"function",
"getPriceValueAttribute",
"(",
")",
"{",
"$",
"obPriceModel",
"=",
"$",
"this",
"->",
"getPriceObject",
"(",
"$",
"this",
"->",
"getActivePriceType",
"(",
")",
")",
";",
"$",
"this",
"->",
"setActivePriceType",
"(",
"null",
")",
";",... | Get price_value attribute
@return float | [
"Get",
"price_value",
"attribute"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/models/Offer.php#L344-L357 |
lovata/oc-shopaholic-plugin | models/Offer.php | Offer.getOldPriceValueAttribute | protected function getOldPriceValueAttribute()
{
$obPriceModel = $this->getPriceObject($this->getActivePriceType());
$this->setActivePriceType(null);
if (empty($obPriceModel)) {
return 0;
}
$fPrice = $obPriceModel->old_price_value;
$fPrice = CurrencyHelp... | php | protected function getOldPriceValueAttribute()
{
$obPriceModel = $this->getPriceObject($this->getActivePriceType());
$this->setActivePriceType(null);
if (empty($obPriceModel)) {
return 0;
}
$fPrice = $obPriceModel->old_price_value;
$fPrice = CurrencyHelp... | [
"protected",
"function",
"getOldPriceValueAttribute",
"(",
")",
"{",
"$",
"obPriceModel",
"=",
"$",
"this",
"->",
"getPriceObject",
"(",
"$",
"this",
"->",
"getActivePriceType",
"(",
")",
")",
";",
"$",
"this",
"->",
"setActivePriceType",
"(",
"null",
")",
"... | Get old_price_value attribute
@return float | [
"Get",
"old_price_value",
"attribute"
] | train | https://github.com/lovata/oc-shopaholic-plugin/blob/f6124c3aaae626ee01e88cceb911677657e80495/models/Offer.php#L363-L377 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.