Factory/TopFactory.php
public function createEntity(array $data, $rank = false)
    {
        if (false === $rank) {
            $rank = Top::create();
        }

        if (isset($data['top'])) {
            $rank = $rank->setRanks($this->createRanks($data['top']));
        }

        if (isset($data['_links'])) {
            $rank = $rank->setLinks($data['_links']);
        }

        if (isset($data['_total'])) {
            $rank = $rank->setTotal($data['_total']);
        }

        return $rank;
    }
public function createEntity(array $data, $rank = false)
    {
        if (false === $rank) {
            $rank = Top::create();
        }

        if (isset($data['top'])) {
            $rank = $rank->setRanks($this->createRanks($data['top']));
        }

        if (isset($data['_links'])) {
            $rank = $rank->setLinks($data['_links']);
        }

        if (isset($data['_total'])) {
            $rank = $rank->setTotal($data['_total']);
        }

        return $rank;
    }
@param array      $data
@param false|Rank $rank

@return Rank