@param array $data

@return Tv
979510
public function create(array $data = [])
    {
        if (!$data) {
            return null;
        }

        $tvShow = new Tv();

        if (array_key_exists('content_ratings', $data) && array_key_exists('results', $data['content_ratings'])) {
            $tvShow->setContentRatings(
                $this->createGenericCollection($data['content_ratings']['results'], new Tv\ContentRating())
            );
        }

        if (array_key_exists('credits', $data)) {
            if (array_key_exists('cast', $data['credits']) && $data['credits']['cast'] !== null) {
                $tvShow->getCredits()->setCast(
                    $this->getCastFactory()->createCollection(
                        $data['credits']['cast'],
                        new CastMember()
                    )
                );
            }

            if (array_key_exists('crew', $data['credits']) && $data['credits']['crew'] !== null) {
                $tvShow->getCredits()->setCrew(
                    $this->getCrewFactory()->createCollection(
                        $data['credits']['crew'],
                        new CrewMember()
                    )
                );
            }
        }

        /** External ids */
        if (array_key_exists('external_ids', $data) && $data['external_ids'] !== null) {
            $tvShow->setExternalIds(
                $this->hydrate(new ExternalIds(), $data['external_ids'])
            );
        }

        /** Genres */
        if (array_key_exists('genres', $data) && $data['genres'] !== null) {
            $tvShow->setGenres($this->getGenreFactory()->createCollection($data['genres']));
        }

        /** Genres */
        if (array_key_exists('genre_ids', $data)) {
            $formattedData = [];

            foreach ($data['genre_ids'] as $genreId) {
                $formattedData[] = [
                    'id' => $genreId
                ];
            }

            $tvShow->setGenres($this->getGenreFactory()->createCollection($formattedData));
        }

        /** Images */
        if (array_key_exists('images', $data) && $data['images'] !== null) {
            $tvShow->setImages(
                $this->getImageFactory()->createCollectionFromTv($data['images'])
            );
        }

        if (array_key_exists('backdrop_path', $data)) {
            $tvShow->setBackdropImage(
                $this->getImageFactory()->createFromPath($data['backdrop_path'], 'backdrop_path')
            );
        }

        if (array_key_exists('poster_path', $data)) {
            $tvShow->setPosterImage(
                $this->getImageFactory()->createFromPath($data['poster_path'], 'poster_path')
            );
        }

        /** Translations */
        if (array_key_exists('translations', $data) && null !== $data['translations']) {

            if (array_key_exists('translations', $data['translations'])) {
                $translations = $data['translations']['translations'];
            } else {
                $translations = $data['translations'];
            }

            $tvShow->setTranslations(
                $this->createGenericCollection($translations, new Translation())
            );
        }

        /** Seasons */
        if (array_key_exists('seasons', $data) && $data['seasons'] !== null) {
            $tvShow->setSeasons($this->getTvSeasonFactory()->createCollection($data['seasons']));
        }

        /** Networks */
        if (array_key_exists('networks', $data) && $data['networks'] !== null) {
            $tvShow->setNetworks($this->getNetworkFactory()->createCollection($data['networks']));
        }

        if (array_key_exists('videos', $data) && $data['videos'] !== null) {
            $tvShow->setVideos($this->getVideoFactory()->createCollection($data['videos']));
        }

        if (array_key_exists('keywords', $data) && array_key_exists('results', $data['keywords'])) {
            $tvShow->setKeywords($this->getKeywordFactory()->createCollection($data['keywords']['results']));
        }

        if (array_key_exists('changes', $data)  && $data['changes'] !== null) {
            $tvShow->setChanges($this->getChangesFactory()->createCollection($data['changes']));
        }

        if (array_key_exists('similar', $data)  && $data['similar'] !== null) {
            $tvShow->setSimilar($this->createResultCollection($data['similar']));
        }

        if (array_key_exists('recommendations', $data)  && $data['recommendations'] !== null) {
            $tvShow->setRecommendations($this->createResultCollection($data['recommendations']));
        }

        if (array_key_exists('languages', $data) && $data['languages'] !== null) {
            $collection = new GenericCollection();

            foreach ($data['languages'] as $iso6391) {
                $object = new SpokenLanguage();
                $object->setIso6391($iso6391);

                $collection->add(null, $object);
            }

            $tvShow->setLanguages($collection);
        }

        if (array_key_exists('origin_country', $data) && $data['origin_country'] !== null) {
            $collection = new GenericCollection();

            foreach ($data['origin_country'] as $iso31661) {
                $object = new Country();
                $object->setIso31661($iso31661);

                $collection->add(null, $object);
            }

            $tvShow->setOriginCountry($collection);
        }

        if (array_key_exists('production_companies', $data)) {
            $tvShow->setProductionCompanies(
                $this->createGenericCollection($data['production_companies'], new Company())
            );
        }

        if (array_key_exists('created_by', $data) && $data['created_by'] !== null) {
            $collection = new GenericCollection();
            $factory =  new PeopleFactory($this->getHttpClient());

            foreach ($data['created_by'] as $castMember) {
                $object = $factory->create($castMember, new CastMember());

                $collection->add(null, $object);
            }

            $tvShow->setCreatedBy($collection);
        }

        if (array_key_exists('alternative_titles', $data) && array_key_exists('results', $data['alternative_titles'])) {
            $tvShow->setAlternativeTitles(
                $this->createGenericCollection($data['alternative_titles']['results'], new Tv\AlternativeTitle())
            );
        }

        return $this->hydrate($tvShow, $data);
    }
1214620
public static function format(array $data) {
        return array_map(function ($item) {
            $args = static::toArrOrNone($item);
            if (false !== $args) {
                return $args;
            }
            return $item;
        }, $data);
    }
904813
public function model(array $data = array())
    {
        $model = trim(str_replace('\\', '_', $this->model), '_');
        return $this->$model($data)->setDatabase($this);
    }
1165688
public static function make(array $data)
    {
        # Convert values to ArrayObject instances
        foreach ($data as &$value) {
            if (is_array($value)) {
                $value = static::make($value);
            }
        }
        unset($value);

        return new self($data, \ArrayObject::ARRAY_AS_PROPS);
    }
1321478
protected function setWithArrayData(array $data)
    {
        if (isset($data[0])) { // multiple rows
            foreach ($data as $row) {
                $this->set($row);
            }
        } else { // multiple values
            foreach ($data as $col => $val) {
                $this->set($col, $val);
            }
            $this->set_row++;
        }
        return $this;
    }
1006641
public function fill(array $data)
    {
        if (empty($data['url']) || !is_string($data['url']) ||
            strpos($data['url'], $this->browser->getHost()) !== 0 ||
            !preg_match(self::REG_ITEM_ID, $data['url'], $match)
        ) {
            return null;
        }
        $path = str_replace('#ID#', $match['id'], self::FILL_URL);
        $body = $this->browser->get($path);

        $item = new Item();
        $item->setDuration($body['duration']);
        $item->setSummary($body['description']);
        $item->setDatePremiere(new \DateTime($body['aired_on']));
        if ($body['released_on']) {
            $item->setDateEnd(new \DateTime($body['released_on']));
        }
        $ep_num = $body['episodes_aired'] ? $body['episodes_aired'] : $body['episodes'];
        $item->setEpisodesNumber($ep_num.($body['ongoing'] ? '+' : ''));

        // set main source
        $source = new Source();
        $source->setUrl($data['url']);
        $item->addSource($source);

        // set complex data
        $this->setSources($item, $body);
        $this->setCover($item, $body);
        $this->setType($item, $body);
        $this->setNames($item, $body);
        $this->setGenres($item, $body);
        $this->setStudio($item, $body);

        if (!empty($data['frames'])) {
            $this->setImages($item, $body);
        }

        return $item;
    }
895807
public final function load(array $data): self
    {
        foreach ($data as $key => $value) {
            $this->set($key, $value);
        }

        return $this;
    }
212786
public function filter(array $data)
    {
        $data = $this->filterArrayWithGlobalChain($data);

        $this->data = new Container($data);

        $this->filterChains();

        return $this->data->getArrayCopy();
    }
488099
public function flash(array $data = array())
    {
        if(count($data) == 0 && $this->exe->request === null)
            return;

        $data = count($data) > 0 ? $data : $this->exe->request->getParsedBody();

        $this->exe->flash->set('form_data', $data);

        return $this;
    }
978130
private function setProperties(array $data)
    {
        foreach ($data as $key => $value) {
            $this->setProperty($key, $value);
        }

        return $this;
    }
782378
private function setCoreData(array $data)
    {
        if (isset($data['input_type'])) {
            $this->setInputType($data['input_type']);
        }

        if (isset($data['display_type'])) {
            $this->setDisplayType($data['display_type']);
        }

        if (isset($data['property_type'])) {
            $this->setPropertyType($data['property_type']);
        }

        if (isset($data['output_type'])) {
            $this->setOutputType($data['output_type']);
        }

        if (isset($data['type'])) {
            $this->setType($data['type']);
        }

        return $data;
    }
130010
public static function fromArray(array $data)
    {
        return new PhpUnit(
            new Undefined(false),
            new Enabled($data['enabled']),
            new PhpUnitRandomMode($data['random-mode']),
            new PhpUnitOptions($data['options'])
        );
    }
1155655
protected function createReceiveImageMsg(array $data)
    {
        $result = new WxReceiveImageMsg();
        $this->initReceiveMsg($result, $data);
        $result->setMediaId(isset($data['MediaId']) ? trim($data['MediaId']) : '');
        $result->setPicUrl(isset($data['PicUrl']) ? trim($data['PicUrl']) : '');
        return $result;
    }
857709
public function setSoftStage(array $data)
    {
        //one dimenstions soft setter
        foreach ($data as $key => $value) {
            if ($this->exists('stage', $key)) {
                continue;
            }

            $this->set('stage', $key, $value);
        }

        return $this;
    }
1217550
protected function createReceiveVideoMsg(array $data)
    {
        $result = new WxReceiveVideoMsg();
        $this->initReceiveMsg($result, $data);
        $result->setMediaId(isset($data['MediaId']) ? trim($data['MediaId']) : '');
        $result->setThumbMediaId(isset($data['ThumbMediaId']) ? trim($data['ThumbMediaId']) : '');
        return $result;
    }
921049
public function toObject(array $data)
    {
        $data = json_decode(json_encode($data));

        if ($data === []) {
            $data = new \StdClass();
        }

        return $data;
    }
1253975
public function data(array $data)
    {
        if (!is_array($this->props['data'])) $this->props['data'] = [];
        $this->props['data'] = array_merge($this->props['data'], $data);
        return $this;
    }