Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to extending base types #311

Closed
gitlog opened this issue Jul 6, 2020 · 3 comments
Closed

How to extending base types #311

gitlog opened this issue Jul 6, 2020 · 3 comments
Labels

Comments

@gitlog
Copy link

gitlog commented Jul 6, 2020

Q A
Version 1.2.0

Support Question

How to set base type on generate types https://github.com/phpro/soap-client/blob/master/docs/code-generation/assemblers.md#extendassembler

Example extending base types

<xs:complexType name="LegalRef">
  <xs:complexContent mixed="false">
    <xs:extension base="tns:Ref">
      <xs:sequence>
        <xs:element name="code" nillable="true" type="xs:string"/>
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

Expected behavior
Response should be:

class LegalRef extends Ref {

	private $code;
}
@veewee
Copy link
Contributor

veewee commented Jul 7, 2020

Something like this:

new Rules\TypenameMatchesRule(
    new Rules\AssembleRule(new Assembler\ExtendAssembler('Ref')),
    '/^LegalRef$/'
)

You'll need to map those extends manually, since we don't get that information from ext-soap.

@veewee veewee added the question label Jul 7, 2020
@veewee veewee closed this as completed Jul 7, 2020
@drupol
Copy link
Contributor

drupol commented Sep 11, 2020

Pay attention that if you use this, you might most probably not be able to use the FinalClassAssembler.

@veewee
Copy link
Contributor

veewee commented Oct 28, 2022

Hello,

We noticed this issue got reported many times and want to tackle it at its core!
Therefore, we've planned a project that will work on better types support.
It’s going to be a huge project, so we are looking for ways to make development possible during our business hours instead of in our developers precious spare time.

In case you want this feature as badly as us: find out how you can support this project here 💚!

@veewee veewee mentioned this issue Apr 3, 2023
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants