/** * @param $product * @return ShopifyProductEntity */ public static function createFromProductCreationResponse($product) { $self = new self(); $self->setId($product['product']['id']); $self->setVariantId($product['product']['variants'][0]['id']); $self->setCreatedAt(new \DateTime()); $self->setUpdatedAt(new \DateTime()); $self->setSku($product['product']['variants'][0]['sku']); $self->setHandle($product['product']['handle']); return $self; }