# media-cloud-sync/1.2.0/includes/sdk/s3/Aws/Result.php

Media Cloud Sync, version 1.2.0. 52 lines.

- Page: https://pluginprobe.com/plugins/media-cloud-sync/1.2.0/code/includes/sdk/s3/Aws/Result.php
- Raw: https://pluginprobe.com/plugins/media-cloud-sync/1.2.0/raw/includes/sdk/s3/Aws/Result.php
- Modified: 2024-10-27T10:40:38+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/media-cloud-sync/1.2.0/code/includes/sdk/s3/Aws/Result.php#L10-L20`.

```php
<?php

namespace Dudlewebs\WPMCS\s3\Aws;

use Dudlewebs\WPMCS\s3\JmesPath\Env as JmesPath;
/**
 * AWS result.
 */
class Result implements ResultInterface, MonitoringEventsInterface
{
    use HasDataTrait;
    use HasMonitoringEventsTrait;
    public function __construct(array $data = [])
    {
        $this->data = $data;
    }
    public function hasKey($name)
    {
        return isset($this->data[$name]);
    }
    public function get($key)
    {
        return $this[$key];
    }
    public function search($expression)
    {
        return JmesPath::search($expression, $this->toArray());
    }
    public function __toString()
    {
        $jsonData = \json_encode($this->toArray(), \JSON_PRETTY_PRINT);
        return <<<EOT
Model Data
----------
Data can be retrieved from the model object using the get() method of the
model (e.g., `\$result->get(\$key)`) or "accessing the result like an
associative array (e.g. `\$result['key']`). You can also execute JMESPath
expressions on the result data using the search() method.

{$jsonData}

EOT;
    }
    /**
     * @deprecated
     */
    public function getPath($path)
    {
        return $this->search(\str_replace('/', '.', $path));
    }
}

```
