Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Add maxLength to ParameterContainer #4726

Conversation

postalservice14
Copy link
Contributor

The Oci8/Statement class currently sets the max length parameter of oci_bind_by_name to -1. I need to be able to manually set this parameter.

This is my approach to doing this.

Use the new maxlength data in the Oci8 statement class
@ghost ghost assigned ralphschindler Jun 28, 2013
@ralphschindler
Copy link
Member

This is a tough one for me. I really intended that kind of data to travel in errata, but the primary implementation is for passing additional type hints. Let me chew on this and see if I can make a suggestion that doesn't involve creating an API inside ParameterContainer that (logistically speaking) will only ever be used by Oracle drivers.

@postalservice14
Copy link
Contributor Author

Yeah, totally understand. I can't remember now why I didn't use errata, but I thought there was a reason. I can look into it again too, when i have a second.

@ralphschindler
Copy link
Member

Did you have any ideas here or want me to attempt to work something up in the coming days?

@postalservice14
Copy link
Contributor Author

Sorry, been a busy week/holiday weekend. :-)

I started looking into it and now it's all coming back to me. Here are the reasons why I couldn't (and shouldn't IMO) use errata:

  1. I couldn't use errata, because you can only store one piece of errata data per parameter. So if I were to use errata, I wouldn't be able to use it for anything else.
  2. Errata, to me, means an error, and this really isn't an error case.
  3. I needed to be able to set a maxLength on a per parameter basis.

So after looking it over, I still stand by my changes. I'm totally open to suggestions, and would love to see what you come up with, but I'm thinking this is the best way to handle this particular problem.

Thanks!

@mwillbanks
Copy link
Contributor

@ralphschindler any thoughts here?

@Ocramius
Copy link
Member

Requires a rebase

@postalservice14
Copy link
Contributor Author

Pulled in master.


if ($maxLength) {
$this->offsetSetMaxLength($name, $maxLength);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no test case covering this change to offsetSet

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, tests have been updated.

@adamlundrigan
Copy link
Contributor

@ralphschindler how do you feel about this one now that some time has passed?

@weierophinney weierophinney added this to the 2.4.0 milestone Feb 19, 2015
weierophinney added a commit that referenced this pull request Feb 19, 2015
…container

Add maxLength to ParameterContainer
weierophinney added a commit that referenced this pull request Feb 19, 2015
@weierophinney
Copy link
Member

Merged to develop for release with 2.4.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants