Skip to content

Instantly share code, notes, and snippets.

@joubertredrat
Created April 27, 2018 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joubertredrat/782c4c2f5f0a966f9a513aa5bbe0548b to your computer and use it in GitHub Desktop.
Save joubertredrat/782c4c2f5f0a966f9a513aa5bbe0548b to your computer and use it in GitHub Desktop.
/**
 * @return array
 */
public function toArray(): array
{
    return [
        'id' => $this->customer->getId(),
        'account' => [
            'id' => $this->customer->getAccount()->getId(),
        ],
        'accountNumber' => $this->customer->getAccountNumber(),
        'created' => $this->customer->getCreatedAsString(),
        'updated' => $this->customer->getUpdatedAsString(),
    ];
}
/**
 * @return array
 */
public function toArray(): array
{
    return [
        'id' => $this
            ->customer
            ->getId()
        ,
        'account' => [
            'id' => $this
                ->customer
                ->getAccount()
                ->getId()
            ,
        ],
        'accountNumber' => $this
            ->customer
            ->getAccountNumber()
        ,
        'created' => $this
            ->customer
            ->getCreatedAsString()
        ,
        'updated' => $this
            ->customer
            ->getUpdatedAsString()
        ,
    ];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment