_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 33 8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q252500 | Casings.pascal2snake | validation | public static function pascal2snake(string $pascal): string
{
preg_match_all('/((?:^|[A-Z])[a-z]+)/', $pascal, $matches);
if($matches !== null && count($matches) > 1 && count($matches[1]) > 1)
{
$nameParts = $matches[1];
| php | {
"resource": ""
} |
q252501 | Casings.snake2pascal | validation | public static function snake2pascal(string $snake): string
{
$nameParts = explode("_", $snake);
| php | {
"resource": ""
} |
q252502 | RemotableCollection.add | validation | public function add(MethodInterface $method)
{
if ($this->isUnique($method)) {
$this->collection[] = $method;
} else {
| php | {
"resource": ""
} |
q252503 | Console.main | validation | public static function main($argv, ContainerInterface $container = null)
{
$output = self::cyanLine($argv);
$app = new Application('');
$app->add(new MigrateMakeCommand());
$app->add(new MigrateUpCommand($container));
$app->add(new MigrateDownCommand());
$app->add(ne... | php | {
"resource": ""
} |
q252504 | Collection.isUnique | validation | protected function isUnique($instance)
{
foreach ($this->getCollection() as $entry) {
| php | {
"resource": ""
} |
q252505 | Load.repeat | validation | public function repeat(&$property, $repeatTag, $classes = '', $outerTag = false, $outerClasses = '')
{
if (isset($property)) {
$output = '';
if ($outerTag) { $output .= '<'.$outerTag.' class="'.$outerClasses.'">'; }
if (is_array($property)) {
foreach ($pro... | php | {
"resource": ""
} |
q252506 | Load.model | validation | public function model($pathname) {
$fullPath = $this->config['pathToModels'] .
$this->getPath($pathname) .
$this->config['modelsPrefix'] .
$this->getName($pathname) | php | {
"resource": ""
} |
q252507 | Load.library | validation | public function library($pathname, &$caller = false, $exposeToView = false) {
$name = $this->getName($pathname);
$path = $this->getPath($pathname);
// If a reference to the calling object was passed, set an instance of
// the library as one of its members.
if ($caller) ... | php | {
"resource": ""
} |
q252508 | Load.view | validation | public function view($pathname = '', $data = false, $return = false) {
if (is_array($data) || is_object($data)) {
foreach ($data as $key => $value) {
$$key = $value;
}
}
// If no pathname specified, grab template name.
if ($pathname == '') {
... | php | {
"resource": ""
} |
q252509 | Creator.new | validation | public static function new(
string $type = 'default',
string $path = Migrate::DEFAULT_PATH,
$notify = NotifyInterface::LOGGER
| php | {
"resource": ""
} |
q252510 | Neuron_GameServer_Map_Pathfinder.getPath | validation | public function getPath
(
Neuron_GameServer_Map_Location $start,
Neuron_GameServer_Map_Location $end
)
{
// Start here :-)
$x1 = $start[0];
| php | {
"resource": ""
} |
q252511 | Engine.display | validation | public function display($template, array $vars = array())
{
if (null === ($path = $this->locator->locate($template))) {
throw TemplateNotFoundException::format(
'The template "%s" does not exist.',
| php | {
"resource": ""
} |
q252512 | Engine.render | validation | public function render($template, array $vars = array())
{
ob_start();
try {
$this->display($template, $vars);
} catch (Exception $exception) {
| php | {
"resource": ""
} |
q252513 | Caller.handleResponseContent | validation | protected function handleResponseContent(ResponseInterface $response, $contentType = null)
{
$contents = $response->getBody()->getContents();
if (!$contentType) {
$contentTypeHeaderLine = $response->getHeaderLine('Content-Type');
if (stripos($contentTypeHeaderLine, 'applica... | php | {
"resource": ""
} |
q252514 | HttpMethodsClient.sendRequest | validation | public function sendRequest(RequestInterface $request)
{
$this->lastOperation = new Operation($request);
$response = parent::sendRequest($request);
| php | {
"resource": ""
} |
q252515 | Migrate.install | validation | public function install(): Migrate
{
Whois::print($this->getNotify());
// Create a migration table in the
// database if it does not exist. | php | {
"resource": ""
} |
q252516 | ExtDirectResponse.buildResponse | validation | protected function buildResponse()
{
$res = array();
$res['type'] = $this->getParameters()->getType();
$res['tid'] = $this->getParameters()->getTid();
$res['action'] = $this->getParameters()->getAction();
| php | {
"resource": ""
} |
q252517 | PurchaseResponse.getMessage | validation | public function getMessage()
{
$response = [];
if ($messages = $this->data->query('/Message/Body/Errors')->array()) {
foreach ($messages as $message) {
$response[] = | php | {
"resource": ""
} |
q252518 | MigrationCreator.getStubs | validation | protected function getStubs(?string $table = null, bool $create = false): iterable
{
if (is_null($table)) {
yield M::TYPE_UP => $this->stubs->read('blank.sql.stub');
yield M::TYPE_DOWN => $this->stubs->read('blank.sql.stub');
return;
}
$first = [M::TYPE_U... | php | {
"resource": ""
} |
q252519 | MigrationCreator.populateStub | validation | protected function populateStub(string $filename, string $stub, ?string $table = null): string
{
$search = ['{name}', '{table}'];
$replace | php | {
"resource": ""
} |
q252520 | EmailUtilities.applyDataToView | validation | public static function applyDataToView($view, $data)
{
// do placeholder replacement, currently {xxx}
if (!empty($data)) {
foreach ($data as $name => $value) { | php | {
"resource": ""
} |
q252521 | PhpErrorUtil.getErrorString | validation | public static function getErrorString( int $errno )
{
$errno = intval($errno);
$errors = array(
E_ERROR => 'E_ERROR',
E_WARNING => 'E_WARNING',
E_PARSE => 'E_PARSE',
E_NOTICE => 'E_NOTIC... | php | {
"resource": ""
} |
q252522 | NumberGenerator.getFloat | validation | public function getFloat($min, $max)
{
if ($min > $max) {
throw new InvalidArgumentException('Min cannot be greater than max');
}
$random01 = \mt_rand() / \mt_getrandmax();
// [0, | php | {
"resource": ""
} |
q252523 | Model._populate | validation | public function _populate($record = null, $db = false, $loadMap = false)
{
// In order to stop unnecessary recursive issetExtended() checks while doing initial hydrating of model.
$this->model_hydrating = true;
// If this model is having a custom DB object passed into it,
// then we'll use ... | php | {
"resource": ""
} |
q252524 | Model._populateAttributes | validation | protected function _populateAttributes($record)
{
foreach ($this->model_attributes as $key => $def) {
// If the data is present in the DB, assign to model.
// Otherwise ignore any data returned from the DB that isn't defined in the model.
if (isset($record[$this->getFieldName($key)]))... | php | {
"resource": ""
} |
q252525 | Model._populateNonModelData | validation | protected function _populateNonModelData($record)
{
$nonObjectData = array_diff_key($record, $this->model_attributes);
if (count($nonObjectData) > 0) {
foreach ($nonObjectData as $key => $value) {
// Note that if the model is using custom field names, this will result in a piece of da... | php | {
"resource": ""
} |
q252526 | Model.isPlaceholder | validation | public function isPlaceholder($attributeName)
{
// Ref this model's attributes in a shorter variable.
$def = $this->model_attributes[$attributeName];
if (isset($def['models']) | php | {
"resource": ""
} |
q252527 | Model._getQueryObjectForRelation | validation | protected function _getQueryObjectForRelation($attribute)
{
// Setup
$def = $this->model_attributes[$attribute];
// If not a model relationship, just return an adaptor for this model
if (!isset($def['model']) && !isset($def['models'])) {
return $this->getDbAdaptor();
}
... | php | {
"resource": ""
} |
q252528 | Model._getCustomValue | validation | protected function _getCustomValue($attributeName, $query, $loadMap = false)
{
$def = $this->model_attributes[$attributeName];
$result = $this->_getRelation($attributeName, $query, $loadMap); | php | {
"resource": ""
} |
q252529 | Model._getRelation | validation | protected function _getRelation($attributeName, $query = false, $loadMap = false, $record = false)
{
// Grab attribute definition
$def = $this->model_attributes[$attributeName];
$result = false;
if (isset($def['models'])) {
$result = $this->_getModels($attributeName, $def['mod... | php | {
"resource": ""
} |
q252530 | Model._getModel | validation | protected function _getModel($attributeName, $relatedObjName = false, $query = false, $loadMap = false, $record = false)
{
$def = $this->model_attributes[$attributeName];
$result = null;
if ($relatedObjName) {
// If a LoadMap is present, and explicit fetching of the data isn't enabled, a... | php | {
"resource": ""
} |
q252531 | Model._getModels | validation | protected function _getModels($attributeName, $relatedObjName = false, $query = false, $loadMap = false)
{
$def = $this->model_attributes[$attributeName];
$result = [];
if ($relatedObjName) {
// If the relationship is one-to-many.
if (isset($def['via'])) {
$result = $thi... | php | {
"resource": ""
} |
q252532 | Model._getAttributeDataWhenSet | validation | protected function _getAttributeDataWhenSet($attributeName, $query = false, $loadMap = false, $record = false)
{
// Check if the stored data is numeric.
// If it's not, then we don't need to worry about it being a
// class reference that we need to fetch.
if (is_numeric($this->model_data[$a... | php | {
"resource": ""
} |
q252533 | Model._getAttributeDataWhenUnset | validation | protected function _getAttributeDataWhenUnset($attributeName, $query = false, $loadMap = false, $record = false)
{
// If the attribute isn't the primary key of our current model, do dynamic fetch.
if ($attributeName != $this->getPrimaryKey()) {
// If the attribute is defined as a m... | php | {
"resource": ""
} |
q252534 | Model._getAttributeData | validation | protected function _getAttributeData($name, $query = false, $loadMap = false, $record = false)
{
///////////////////////////////////////////////////////////////////////
// -------------------------------------
// If the model DB data is already set.
// -------------------------------------
... | php | {
"resource": ""
} |
q252535 | Model.getDataAttributes | validation | public function getDataAttributes($excludeExtended = false)
{
$attributes = new \Cora\Collection();
foreach ($this->model_attributes as $key => $def) {
if (!isset($def['model']) && !isset($def['models'])) {
$attributes->add($key);
}
}
if (is... | php | {
"resource": ""
} |
q252536 | Model.getAttributeValue | validation | public function getAttributeValue($name, $convertDates = true)
{
if (isset($this->model_data[$name])) {
$result = $this->model_data[$name];
if ($result instanceof \DateTime && $convertDates == true) {
$result = $result->format('Y-m-d H:i:s');
| php | {
"resource": ""
} |
q252537 | Model.getAttributeValueExtended | validation | public function getAttributeValueExtended($name, $convertDates = true)
{
if (isset($this->model_data[$name])) {
$result = $this->model_data[$name];
if ($result instanceof \DateTime && $convertDates == true) {
$result = $result->format('Y-m-d H:i:s');
}
| php | {
"resource": ""
} |
q252538 | Model._getModelsFromTableColumn | validation | protected function _getModelsFromTableColumn($attributeName, $objName, $relationColumnName, $query = false, $loadMap = false)
{
// Figure out the unique identifying field of the model we want to grab.
$relatedObj = $this->fetchRelatedObj($objName);
$idField = $relatedObj->getPrimaryKey();
/... | php | {
"resource": ""
} |
q252539 | Model.getModelsFromCustomRelationship | validation | public function getModelsFromCustomRelationship($attributeName, $objName, $query = false, $loadMap = false)
{
// Create a repository for the related object.
$repo = \Cora\RepositoryFactory::make($objName, false, false, false, $this->model_db);
// Grab a Query Builder object for the connect... | php | {
"resource": ""
} |
q252540 | Model.getFullClassName | validation | function getFullClassName($class = false)
{
if ($class == false) { $class = $this; }
| php | {
"resource": ""
} |
q252541 | Model._fetchData | validation | protected function _fetchData($name)
{
$gateway = new \Cora\Gateway($this->getDbAdaptor(), | php | {
"resource": ""
} |
q252542 | Model.getFieldName | validation | public function getFieldName($attributeName)
{
if (isset($this->model_attributes[$attributeName]['field'])) {
| php | {
"resource": ""
} |
q252543 | Model.loadAll | validation | public function loadAll()
{
$this->data->id = $this->id;
foreach ($this->model_attributes as $key | php | {
"resource": ""
} |
q252544 | ReaderAbstract.checkPath | validation | protected static function checkPath(/*# string */ $path)
{
if (!file_exists($path)) {
throw new NotFoundException(
Message::get(Message::MSG_PATH_NOTFOUND, $path),
| php | {
"resource": ""
} |
q252545 | Sanitizer.name | validation | public static function name($string = null)
{
if (!$string) return null;
// Convert to lowercase, set UTF-8 character encoding, trim and return | php | {
"resource": ""
} |
q252546 | Sanitizer.email | validation | public static function email($email = null, $errorMsg = null)
{
if (!$email) return null;
// Convert to lowercase and set UTF-8 character encoding
| php | {
"resource": ""
} |
q252547 | Neuron_GameServer_Mappers_PlayerMapper.getDataFromId | validation | public static function getDataFromId ($id)
{
$db = Neuron_Core_Database::__getInstance ();
$id = intval ($id);
$r = $db->getDataFromQuery ($db->customQuery
("
SELECT
*
FROM
| php | {
"resource": ""
} |
q252548 | ApiClient.sendMessage | validation | public function sendMessage(
$chatId,
$text,
$disableWebPagePreview = null,
$replyToMessageId = null,
$replyMarkup = null
) {
$response = $this->apiRequest("sendMessage", [
"chat_id" => $chatId,
"text" => $text,
"disable_web_page_pr... | php | {
"resource": ""
} |
q252549 | ApiClient.entityFromBody | validation | public function entityFromBody($body, $entity)
{
$json = $this->decodeJson($body);
| php | {
"resource": ""
} |
q252550 | SeedCreator.populateStub | validation | protected function populateStub(string $stub, ?string $class = null): string | php | {
"resource": ""
} |
q252551 | MappingTrait.setMappings | validation | public static function setMappings(
array $messages,
/*# bool */ $manual = true
) {
$class = get_called_class();
if ($manual) {
// set default
| php | {
"resource": ""
} |
q252552 | MappingTrait.getMessage | validation | protected static function getMessage(/*# int */ $code)/*# : string */
{
$mapping = static::getMappings();
if (isset($mapping[$code])) {
| php | {
"resource": ""
} |
q252553 | Consumer.buildAuthString | validation | public static function buildAuthString(array $data)
{
$str = array();
foreach ($data as $k => $v) {
$str[] | php | {
"resource": ""
} |
q252554 | Consumer.buildBasestring | validation | public static function buildBasestring($method, Url $url, array $data)
{
$base = array();
$base[] = self::urlEncode(self::getNormalizedMethod($method));
$base[] = self::urlEncode(self::getNormalizedUrl($url));
| php | {
"resource": ""
} |
q252555 | Consumer.getNormalizedUrl | validation | public static function getNormalizedUrl(Url $url)
{
$scheme = $url->getScheme();
$host = $url->getHost();
$port = $url->getPort();
$path = $url->getPath();
// no port for 80 (http) and 443 (https)
if ((($port == 80 || empty($port)) && strcasecmp($scheme, 'http'... | php | {
"resource": ""
} |
q252556 | Consumer.getNormalizedParameters | validation | public static function getNormalizedParameters(array $data)
{
$params = array();
$keys = array_map('PSX\Oauth\Consumer::urlEncode', array_keys($data));
$values = array_map('PSX\Oauth\Consumer::urlEncode', array_values($data));
$data = array_combine($keys, $values);
uks... | php | {
"resource": ""
} |
q252557 | Neuron_GameServer_Credits.handleUseRequest | validation | public function handleUseRequest ($data, $transactionId, $transactionKey)
{
if (!$this->objCredits) {
return null;
}
if (isset ($_POST['transaction_id']) && isset ($_POST['transaction_secret']))
{
$valid = $this->objCredits->isRequestValid ($_POST['transaction_id'], $_POST['transaction_secret']); | php | {
"resource": ""
} |
q252558 | NotifyLogger.note | validation | public function note(string $message): void
{
| php | {
"resource": ""
} |
q252559 | AbstractRequest.getBaseData | validation | public function getBaseData()
{
$data = new FluidXml(false);
$message = $data->addChild('Message', ['version' => $this->getApiVersion()], true);
$header = $message->addChild('Header', true);
$header->addChild('Time', $this->getTime());
$itentity = $header->addChild('Identi... | php | {
"resource": ""
} |
q252560 | Neuron_Auth_MySQLConnection.query | validation | function query($sql, $params = array())
{
$db = Neuron_DB_Database::getInstance ();
$sql = $this->printf ($sql, $params);
if ($this->debug)
{
echo $sql . "<br><br>";
}
try
{
//echo $sql . "<br><br>";
$data = $db->query ($... | php | {
"resource": ""
} |
q252561 | Neuron_Auth_MySQLConnection.getOne | validation | function getOne($sql, $params = array())
{
//echo 'get one --- ';
$data = $this->query ($sql, $params);
if (count ($data) > 0)
{
| php | {
"resource": ""
} |
q252562 | Neuron_Auth_MySQLConnection.getRow | validation | function getRow($sql, $params = array())
{
//echo 'get row --- ';
$data = $this->query ($sql, $params);
$row = false;
if (count ($data) > 0)
{
| php | {
"resource": ""
} |
q252563 | ExtDirectRequest.getAnnotationClassForAction | validation | protected function getAnnotationClassForAction($requestAction)
{
/** @var array $actions */
$actions = $this->getActions();
/** @var ClassInterface $action */
foreach ($actions as $action) {
if ($action->getAnnotatedName() === $requestAction) {
| php | {
"resource": ""
} |
q252564 | ExtDirectRequest.getAnnotationMethodForMethod | validation | protected function getAnnotationMethodForMethod(ClassInterface $class, $requestMethod)
{
/** @var MethodInterface $method */
foreach ($class->getMethods() as $method) {
if ($method->getAnnotatedName() === $requestMethod) {
| php | {
"resource": ""
} |
q252565 | ConversionTrait.convertCase | validation | public static function convertCase(
/*# string */ $string,
/*# string */ $toCase
)/*# string */ {
// break into lower case words
$str = strtolower(ltrim(
preg_replace(['/[A-Z]/', '/[_]/'], [' $0', ' '], $string)
));
switch (strtoupper($toCase)) {
... | php | {
"resource": ""
} |
q252566 | ConversionTrait.hasSuffix | validation | public static function hasSuffix(
/*# string */ $string,
/*# string */ $suffix
)/*# : bool */ {
$len = strlen($suffix);
| php | {
"resource": ""
} |
q252567 | ConversionTrait.removeSuffix | validation | public static function removeSuffix(
/*# string */ $string,
/*# string */ $suffix
)/*# string */ {
if (static::hasSuffix($string, $suffix)) {
| php | {
"resource": ""
} |
q252568 | Base.getLocations | validation | public function getLocations()
{
if (is_null($this->_locations)) { | php | {
"resource": ""
} |
q252569 | Base.setFormField | validation | public function setFormField($value)
{
if (is_array($value)) {
if (is_null($this->formFieldClass)) {
throw new Exception("DB Field incorrectly set up. What is the form class?");
}
if (is_null($this->_formField)) {
$config = $value;
... | php | {
"resource": ""
} |
q252570 | Base.getHuman | validation | public function getHuman()
{
if (is_null($this->_human)) {
| php | {
"resource": ""
} |
q252571 | Base.getMultiline | validation | public function getMultiline()
{
if (is_null($this->_multiline)) {
$this->_multiline | php | {
"resource": ""
} |
q252572 | Base.setModel | validation | public function setModel($value)
{
$this->_model = $value;
if (is_object($value) && | php | {
"resource": ""
} |
q252573 | Base.setAttributes | validation | public function setAttributes($value)
{
$this->_attributes = $value;
if ($this->model) {
| php | {
"resource": ""
} |
q252574 | Base.setFormat | validation | public function setFormat($value)
{
if (is_array($value)) {
if (!isset($value['class'])) {
$value['class'] = $this->determineFormatClass();
}
| php | {
"resource": ""
} |
q252575 | Base.getFormattedValue | validation | public function getFormattedValue()
{
if ($this->format instanceof BaseFormat) {
$formattedValue = $this->format->get();
} elseif (is_callable($this->format) || (is_array($this->format) && !empty($this->format[0]) && is_object($this->format[0]))) {
$formattedValue = $this->ev... | php | {
"resource": ""
} |
q252576 | Base.getFormValue | validation | public function getFormValue()
{
if ($this->format instanceof BaseFormat) {
$formValue = $this->format->getFormValue();
} elseif (is_callable($this->format) || (is_array($this->format) && !empty($this->format[0]) && is_object($this->format[0]))) {
| php | {
"resource": ""
} |
q252577 | Generator.getBaseNamespace | validation | public function getBaseNamespace()
{
if (!empty($this->moduleSet) && isset(Yii::$app->extensions[$this->moduleSet])) {
$bsClass = Yii::$app->extensions[$this->moduleSet]['bootstrap'];
$bsReflector = new \ReflectionClass(new | php | {
"resource": ""
} |
q252578 | Generator.getMigrationClassName | validation | public function getMigrationClassName()
{
$postfix = '_initial_' . $this->tableName;
if (is_dir($this->migrationDirectory)) {
$searchExisting = FileHelper::findFiles($this->migrationDirectory, ['only' => [$postfix . '.php']]);
if (!empty($searchExisting)) {
| php | {
"resource": ""
} |
q252579 | Generator.getPrimaryKeyLocation | validation | public function getPrimaryKeyLocation($table)
{
// if multiple, put the primary key in the indicies section
$count = 0;
foreach ($table->columns as $column) {
if ($column->isPrimaryKey) {
$count++;
| php | {
"resource": ""
} |
q252580 | Generator.getModuleSetModules | validation | public function getModuleSetModules()
{
if (empty($this->moduleSet) || !isset(Yii::$app->extensions[$this->moduleSet])) {
return '';
}
$bsClass = Yii::$app->extensions[$this->moduleSet]['bootstrap'];
$p = [];
$bs = new $bsClass();
$modules = $bs->getModule... | php | {
"resource": ""
} |
q252581 | Generator.generateRules | validation | public function generateRules($table)
{
$types = [];
$lengths = [];
foreach ($table->columns as $column) {
if ($column->autoIncrement) {
continue;
}
if (!$column->allowNull && $column->defaultValue === null && !$column->isPrimaryKey) {
... | php | {
"resource": ""
} |
q252582 | Generator.getModelMap | validation | public function getModelMap()
{
$m = [];
$search = [];
foreach ($this->searchModels as $path => $namespace) {
$files = FileHelper::findFiles(Yii::getAlias($path), ['only' => ['.php']]);
foreach ($files as $file) {
$baseName = strstr(basename($file), '.... | php | {
"resource": ""
} |
q252583 | FormBuilder.setDesigner | validation | public function setDesigner(Designer $designer){
$this->designer=$designer;
| php | {
"resource": ""
} |
q252584 | FormBuilder.addField | validation | public function addField(FormField $field){
$this->fields[]=$field;
if($field->getName()==null){
$field->setName('name_'.count($this->fields));
}
if($field->getId()==null){
| php | {
"resource": ""
} |
q252585 | FormBuilder.removeField | validation | public function removeField($name){
for($i=0; $i<count($this->fields); $i++){ | php | {
"resource": ""
} |
q252586 | FormBuilder.render | validation | public function render(){
$html=$this->formatter->renderFormBegin($this->formTags);
foreach($this->fields as $field){
$html.=$this->formatter->renderField($field);
} | php | {
"resource": ""
} |
q252587 | FormBuilder.renderFields | validation | public function renderFields(){
$html='';
foreach($this->fields as $field){
| php | {
"resource": ""
} |
q252588 | FormBuilder.renderField | validation | public function renderField($name){
$html='';
$field=$this->getField($name);
| php | {
"resource": ""
} |
q252589 | FormBuilder.getField | validation | public function getField($name){
foreach($this->fields as $field){
if($field->getName()==$name)
return | php | {
"resource": ""
} |
q252590 | FormBuilder.setData | validation | public function setData($data){
$data=$this->transformer->encode($data);
foreach($this->fields as $field){
| php | {
"resource": ""
} |
q252591 | FormBuilder.getData | validation | public function getData(){
$data=[];
foreach($this->fields as $field){
if(preg_match('/^(.*?)(\[.*\])$/',$field->getName(),$result)){
if($result[2]==''){
//FIXME autoincrement field
}
else{
if(!preg_match_all("/\[(.*?)\]/", $result[2], $resultDeep)){
throw new \Exception('Invalid fie... | php | {
"resource": ""
} |
q252592 | FormBuilder.submit | validation | public function submit(Request $request){
$this->isConfirmed=false;
if($this->formTags['method']=='post' && $request->getType()=='POST'){
$this->isConfirmed=true;
}
$query=$request->getQuery();
if(count($this->fields)>0 && $this->formTags['method']=='get' && isset($query[$this->fields[0]->getName()])){
... | php | {
"resource": ""
} |
q252593 | FormBuilder.getErrors | validation | public function getErrors(){
$errors=[];
foreach($this->fields as $field){
if(!$field->isValid()){ | php | {
"resource": ""
} |
q252594 | Phase1.compress | validation | private function compress($dwnlSnap, $pv, $calcId)
{
$in = new \Praxigento\Core\Data();
$in->set(PPhase1::IN_DWNL_PLAIN, $dwnlSnap);
$in->set(PPhase1::IN_PV, $pv);
$in->set(PPhase1::IN_CALC_ID, $calcId);
$in->set(PPhase1::IN_KEY_CALC_ID, EBonDwnl::A_CALC_REF);
$in->se... | php | {
"resource": ""
} |
q252595 | LazyObjectsFactory.generateProxy | validation | private function generateProxy($className)
{
if (isset($this->checkedClasses[$className])) {
return $this->checkedClasses[$className];
}
$proxyParameters = array(
'className' => $className,
'factory' => get_class($this),
... | php | {
"resource": ""
} |
q252596 | Form.getValue | validation | public function getValue($name = null)
{
if ($this->has($name)) {
| php | {
"resource": ""
} |
q252597 | Form.getInputFilter | validation | public function getInputFilter()
{
if ($this->filter) {
return $this->filter;
}
$specifications = [];
if ($this->object && $this->object instanceof InputFilterProviderInterface) {
$specifications = $this->object->getInputFilterSpecification();
}
... | php | {
"resource": ""
} |
q252598 | PermalinkManager.add | validation | public function add($blockFile, $blockContent)
{
$this->removeBlock($blockFile);
$blockPermalinks = $this->fetchPermalinksFromBlock($blockContent, $blockFile);
if (!empty($blockPermalinks)) {
| php | {
"resource": ""
} |
q252599 | PermalinkManager.removeBlock | validation | public function removeBlock($blockFile)
{
foreach ($this->permalinks as $permalink => $associatedBlocks) {
$tmp = array_flip($associatedBlocks);
unset($tmp[$blockFile]);
if (empty($tmp)) {
| php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.