id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
33,700 | silverorange/swat | SwatDB/SwatDBRecordsetWrapper.php | SwatDBRecordsetWrapper.offsetGet | public function offsetGet($offset)
{
if (!isset($this[$offset])) {
throw new OutOfBoundsException(
sprintf('Index %s is out of bounds.', $offset)
);
}
if ($this->index_field === null) {
return $this->objects[$offset];
}
re... | php | public function offsetGet($offset)
{
if (!isset($this[$offset])) {
throw new OutOfBoundsException(
sprintf('Index %s is out of bounds.', $offset)
);
}
if ($this->index_field === null) {
return $this->objects[$offset];
}
re... | [
"public",
"function",
"offsetGet",
"(",
"$",
"offset",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"[",
"$",
"offset",
"]",
")",
")",
"{",
"throw",
"new",
"OutOfBoundsException",
"(",
"sprintf",
"(",
"'Index %s is out of bounds.'",
",",
"$",
"of... | Gets a record in this recordset by an offset value
@param mixed $offset the offset for which to get the record. If this
recordset has a defined index field, the offset is
an index value. Otherwise, the offset is an
ordinal value.
@return SwatDBDataObject the record at the specified offset.
@throws OutOfBoundsExcepti... | [
"Gets",
"a",
"record",
"in",
"this",
"recordset",
"by",
"an",
"offset",
"value"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBRecordsetWrapper.php#L380-L393 |
33,701 | silverorange/swat | SwatDB/SwatDBRecordsetWrapper.php | SwatDBRecordsetWrapper.offsetSet | public function offsetSet($offset, $value)
{
if (
$this->row_wrapper_class !== null &&
!($value instanceof $this->row_wrapper_class)
) {
throw new UnexpectedValueException(
sprintf(
'Value should be an instance of %s.',
... | php | public function offsetSet($offset, $value)
{
if (
$this->row_wrapper_class !== null &&
!($value instanceof $this->row_wrapper_class)
) {
throw new UnexpectedValueException(
sprintf(
'Value should be an instance of %s.',
... | [
"public",
"function",
"offsetSet",
"(",
"$",
"offset",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"row_wrapper_class",
"!==",
"null",
"&&",
"!",
"(",
"$",
"value",
"instanceof",
"$",
"this",
"->",
"row_wrapper_class",
")",
")",
"{",
"th... | Sets a record at a specified offset
@param mixed $offset optional. The offset to set the record at. If this
recordset has a defined index field, the offset is
an index value. Otherwise, the offset is an
ordinal value. If no offset is given, the record
will be added at the end of this recordset.
@param mixed $value th... | [
"Sets",
"a",
"record",
"at",
"a",
"specified",
"offset"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBRecordsetWrapper.php#L418-L493 |
33,702 | silverorange/swat | SwatDB/SwatDBRecordsetWrapper.php | SwatDBRecordsetWrapper.offsetUnset | public function offsetUnset($offset)
{
if (isset($this[$offset])) {
if ($this->index_field === null) {
$this->removed_objects[] = $this->objects[$offset];
unset($this->objects[$offset]);
// update iterator index
if (
... | php | public function offsetUnset($offset)
{
if (isset($this[$offset])) {
if ($this->index_field === null) {
$this->removed_objects[] = $this->objects[$offset];
unset($this->objects[$offset]);
// update iterator index
if (
... | [
"public",
"function",
"offsetUnset",
"(",
"$",
"offset",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"[",
"$",
"offset",
"]",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"index_field",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"removed_objec... | Unsets a record in this recordset at the specified offset
This removes the record at the specified offset from this recordset.
If no such record exists, nothing is done. The record object itself
still exists if there is an external reference to it elsewhere.
@param mixed $offset the offset for which to unset the reco... | [
"Unsets",
"a",
"record",
"in",
"this",
"recordset",
"at",
"the",
"specified",
"offset"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBRecordsetWrapper.php#L510-L546 |
33,703 | silverorange/swat | SwatDB/SwatDBRecordsetWrapper.php | SwatDBRecordsetWrapper.key | public function key()
{
if (
$this->index_field !== null &&
isset($this->current()->{$this->index_field})
) {
$key = $this->current()->{$this->index_field};
} else {
$key = $this->current_index;
}
return $key;
} | php | public function key()
{
if (
$this->index_field !== null &&
isset($this->current()->{$this->index_field})
) {
$key = $this->current()->{$this->index_field};
} else {
$key = $this->current_index;
}
return $key;
} | [
"public",
"function",
"key",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"index_field",
"!==",
"null",
"&&",
"isset",
"(",
"$",
"this",
"->",
"current",
"(",
")",
"->",
"{",
"$",
"this",
"->",
"index_field",
"}",
")",
")",
"{",
"$",
"key",
"=",
... | Returns the key of the current record
If this recordset has an index field defined and the current record has
an index value, this gets the index value. Otherwise this gets the
ordinal position of the record in this recordset.
@return integer the key of the current record. | [
"Returns",
"the",
"key",
"of",
"the",
"current",
"record"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBRecordsetWrapper.php#L575-L587 |
33,704 | silverorange/swat | SwatDB/SwatDBRecordsetWrapper.php | SwatDBRecordsetWrapper.getInternalValues | public function getInternalValues($name)
{
$values = array();
if (count($this) > 0) {
if (!$this->getFirst()->hasInternalValue($name)) {
throw new SwatDBException(
"Records in this recordset do not contain an internal " .
"fiel... | php | public function getInternalValues($name)
{
$values = array();
if (count($this) > 0) {
if (!$this->getFirst()->hasInternalValue($name)) {
throw new SwatDBException(
"Records in this recordset do not contain an internal " .
"fiel... | [
"public",
"function",
"getInternalValues",
"(",
"$",
"name",
")",
"{",
"$",
"values",
"=",
"array",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"this",
")",
">",
"0",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getFirst",
"(",
")",
"->",
"ha... | Gets the values of an internal property for each record in this set
@param string $name name of the internal property to get.
@return array an array of values.
@throws SwatDBException if records in this recordset do not have an
internal value with the specified <i>$name</i>.
@see SwatDBDataObject::getInternalValue(... | [
"Gets",
"the",
"values",
"of",
"an",
"internal",
"property",
"for",
"each",
"record",
"in",
"this",
"set"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBRecordsetWrapper.php#L775-L793 |
33,705 | silverorange/swat | SwatDB/SwatDBRecordsetWrapper.php | SwatDBRecordsetWrapper.loadAllSubDataObjects | public function loadAllSubDataObjects(
$name,
MDB2_Driver_Common $db,
$sql,
$wrapper,
$type = 'integer'
) {
$sub_data_objects = null;
$values = $this->getInternalValues($name);
$values = array_filter($values, function ($value) {
return $va... | php | public function loadAllSubDataObjects(
$name,
MDB2_Driver_Common $db,
$sql,
$wrapper,
$type = 'integer'
) {
$sub_data_objects = null;
$values = $this->getInternalValues($name);
$values = array_filter($values, function ($value) {
return $va... | [
"public",
"function",
"loadAllSubDataObjects",
"(",
"$",
"name",
",",
"MDB2_Driver_Common",
"$",
"db",
",",
"$",
"sql",
",",
"$",
"wrapper",
",",
"$",
"type",
"=",
"'integer'",
")",
"{",
"$",
"sub_data_objects",
"=",
"null",
";",
"$",
"values",
"=",
"$",... | Loads all sub-data-objects for an internal property of the data-objects
in this recordset
This is used to efficiently load sub-objects when there is a one-to-one
relationship between the objects in this recordset and the sub-objects.
This is usually the case when there is a foreign key constraint in the
database table... | [
"Loads",
"all",
"sub",
"-",
"data",
"-",
"objects",
"for",
"an",
"internal",
"property",
"of",
"the",
"data",
"-",
"objects",
"in",
"this",
"recordset"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBRecordsetWrapper.php#L819-L846 |
33,706 | silverorange/swat | SwatDB/SwatDBRecordsetWrapper.php | SwatDBRecordsetWrapper.attachSubDataObjects | public function attachSubDataObjects(
$name,
SwatDBRecordsetWrapper $sub_data_objects
) {
if ($sub_data_objects->index_field === null) {
throw new SwatDBException(
sprintf(
'Index field must be specified in the sub-data-object ' .
... | php | public function attachSubDataObjects(
$name,
SwatDBRecordsetWrapper $sub_data_objects
) {
if ($sub_data_objects->index_field === null) {
throw new SwatDBException(
sprintf(
'Index field must be specified in the sub-data-object ' .
... | [
"public",
"function",
"attachSubDataObjects",
"(",
"$",
"name",
",",
"SwatDBRecordsetWrapper",
"$",
"sub_data_objects",
")",
"{",
"if",
"(",
"$",
"sub_data_objects",
"->",
"index_field",
"===",
"null",
")",
"{",
"throw",
"new",
"SwatDBException",
"(",
"sprintf",
... | Attach existing sub-dataobjects for an internal property of the
dataobjects in this recordset
@param string $name name of the property to attach to.
@param SwatDBRecordsetWrapper $sub_data_objects | [
"Attach",
"existing",
"sub",
"-",
"dataobjects",
"for",
"an",
"internal",
"property",
"of",
"the",
"dataobjects",
"in",
"this",
"recordset"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBRecordsetWrapper.php#L858-L879 |
33,707 | silverorange/swat | SwatDB/SwatDBRecordsetWrapper.php | SwatDBRecordsetWrapper.getIndexes | public function getIndexes()
{
if ($this->index_field === null) {
throw new SwatDBException(
sprintf(
'Index field must be specified in the recordset wrapper ' .
'class (%s::init()) in order to get the record indexes.',
... | php | public function getIndexes()
{
if ($this->index_field === null) {
throw new SwatDBException(
sprintf(
'Index field must be specified in the recordset wrapper ' .
'class (%s::init()) in order to get the record indexes.',
... | [
"public",
"function",
"getIndexes",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"index_field",
"===",
"null",
")",
"{",
"throw",
"new",
"SwatDBException",
"(",
"sprintf",
"(",
"'Index field must be specified in the recordset wrapper '",
".",
"'class (%s::init()) in o... | Gets the index values of the records in this recordset
@return array the index values of the records in this recordset. | [
"Gets",
"the",
"index",
"values",
"of",
"the",
"records",
"in",
"this",
"recordset"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBRecordsetWrapper.php#L1053-L1066 |
33,708 | silverorange/swat | SwatDB/SwatDBRecordsetWrapper.php | SwatDBRecordsetWrapper.getFirst | public function getFirst()
{
$first = null;
if (count($this->objects) > 0) {
$first = reset($this->objects);
}
return $first;
} | php | public function getFirst()
{
$first = null;
if (count($this->objects) > 0) {
$first = reset($this->objects);
}
return $first;
} | [
"public",
"function",
"getFirst",
"(",
")",
"{",
"$",
"first",
"=",
"null",
";",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"objects",
")",
">",
"0",
")",
"{",
"$",
"first",
"=",
"reset",
"(",
"$",
"this",
"->",
"objects",
")",
";",
"}",
"retu... | Retrieves the first object in this recordset
@return mixed the first object or null if there are no objects in this
recordset. | [
"Retrieves",
"the",
"first",
"object",
"in",
"this",
"recordset"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBRecordsetWrapper.php#L1091-L1100 |
33,709 | silverorange/swat | SwatDB/SwatDBRecordsetWrapper.php | SwatDBRecordsetWrapper.getLast | public function getLast()
{
$last = null;
if (count($this->objects) > 0) {
$last = end($this->objects);
}
return $last;
} | php | public function getLast()
{
$last = null;
if (count($this->objects) > 0) {
$last = end($this->objects);
}
return $last;
} | [
"public",
"function",
"getLast",
"(",
")",
"{",
"$",
"last",
"=",
"null",
";",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"objects",
")",
">",
"0",
")",
"{",
"$",
"last",
"=",
"end",
"(",
"$",
"this",
"->",
"objects",
")",
";",
"}",
"return",
... | Retrieves the last object in this recordset
@return mixed the last object or null if there are no objects in this
recordset. | [
"Retrieves",
"the",
"last",
"object",
"in",
"this",
"recordset"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBRecordsetWrapper.php#L1111-L1120 |
33,710 | silverorange/swat | SwatDB/SwatDBRecordsetWrapper.php | SwatDBRecordsetWrapper.remove | public function remove(SwatDBDataObject $remove_object)
{
if (in_array($remove_object, $this->objects, true)) {
$this->removed_objects[] = $remove_object;
if ($this->index_field !== null) {
$index = $remove_object->{$this->index_field};
unset($this->o... | php | public function remove(SwatDBDataObject $remove_object)
{
if (in_array($remove_object, $this->objects, true)) {
$this->removed_objects[] = $remove_object;
if ($this->index_field !== null) {
$index = $remove_object->{$this->index_field};
unset($this->o... | [
"public",
"function",
"remove",
"(",
"SwatDBDataObject",
"$",
"remove_object",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"remove_object",
",",
"$",
"this",
"->",
"objects",
",",
"true",
")",
")",
"{",
"$",
"this",
"->",
"removed_objects",
"[",
"]",
"=",... | Removes a record from this recordset
@param SwatDBDataObject $remove_object the record to remove. | [
"Removes",
"a",
"record",
"from",
"this",
"recordset"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBRecordsetWrapper.php#L1177-L1200 |
33,711 | silverorange/swat | SwatDB/SwatDBRecordsetWrapper.php | SwatDBRecordsetWrapper.removeAll | public function removeAll()
{
$this->removed_objects = array_values($this->objects);
$this->objects = array();
$this->objects_by_index = array();
$this->current_index = 0;
} | php | public function removeAll()
{
$this->removed_objects = array_values($this->objects);
$this->objects = array();
$this->objects_by_index = array();
$this->current_index = 0;
} | [
"public",
"function",
"removeAll",
"(",
")",
"{",
"$",
"this",
"->",
"removed_objects",
"=",
"array_values",
"(",
"$",
"this",
"->",
"objects",
")",
";",
"$",
"this",
"->",
"objects",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"objects_by_index",
... | Removes all records from this recordset | [
"Removes",
"all",
"records",
"from",
"this",
"recordset"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBRecordsetWrapper.php#L1230-L1236 |
33,712 | silverorange/swat | SwatDB/SwatDBRecordsetWrapper.php | SwatDBRecordsetWrapper.reindex | public function reindex()
{
if ($this->index_field !== null) {
$this->objects_by_index = array();
$index_field = $this->index_field;
foreach ($this->objects as $object) {
if (isset($object->$index_field)) {
$this->objects_by_index[$obje... | php | public function reindex()
{
if ($this->index_field !== null) {
$this->objects_by_index = array();
$index_field = $this->index_field;
foreach ($this->objects as $object) {
if (isset($object->$index_field)) {
$this->objects_by_index[$obje... | [
"public",
"function",
"reindex",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"index_field",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"objects_by_index",
"=",
"array",
"(",
")",
";",
"$",
"index_field",
"=",
"$",
"this",
"->",
"index_field",
";",
... | Reindexes this recordset
Reindexing is useful when you have added new data-objects to this
recordset. Reindexing is only done if this recordset has a defined
index field. | [
"Reindexes",
"this",
"recordset"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBRecordsetWrapper.php#L1248-L1259 |
33,713 | silverorange/swat | SwatDB/SwatDBRecordsetWrapper.php | SwatDBRecordsetWrapper.getPropertyValues | public function getPropertyValues($name)
{
$values = array();
if (count($this) > 0) {
if (!isset($this->getFirst()->$name)) {
throw new SwatDBException(
"Records in this recordset do not contain a property " .
"named '{$name}'.... | php | public function getPropertyValues($name)
{
$values = array();
if (count($this) > 0) {
if (!isset($this->getFirst()->$name)) {
throw new SwatDBException(
"Records in this recordset do not contain a property " .
"named '{$name}'.... | [
"public",
"function",
"getPropertyValues",
"(",
"$",
"name",
")",
"{",
"$",
"values",
"=",
"array",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"this",
")",
">",
"0",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"getFirst",
"(",
... | Gets the values of a property for each record in this set
@param string $name name of the property to get.
@return array an array of values.
@throws SwatDBException if records in this recordset do not have a
property with the specified <i>$name</i>. | [
"Gets",
"the",
"values",
"of",
"a",
"property",
"for",
"each",
"record",
"in",
"this",
"set"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBRecordsetWrapper.php#L1274-L1292 |
33,714 | silverorange/swat | SwatDB/SwatDBRecordsetWrapper.php | SwatDBRecordsetWrapper.setDatabase | public function setDatabase(MDB2_Driver_Common $db, array $set = array())
{
$key = spl_object_hash($this);
if (isset($set[$key])) {
// prevent infinite recursion on datastructure cycles
return;
}
$this->db = $db;
$set[$key] = true;
foreach (... | php | public function setDatabase(MDB2_Driver_Common $db, array $set = array())
{
$key = spl_object_hash($this);
if (isset($set[$key])) {
// prevent infinite recursion on datastructure cycles
return;
}
$this->db = $db;
$set[$key] = true;
foreach (... | [
"public",
"function",
"setDatabase",
"(",
"MDB2_Driver_Common",
"$",
"db",
",",
"array",
"$",
"set",
"=",
"array",
"(",
")",
")",
"{",
"$",
"key",
"=",
"spl_object_hash",
"(",
"$",
"this",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"set",
"[",
"$",
"k... | Sets the database driver for this recordset
The database is automatically set for all recordable records of this
recordset.
@param MDB2_Driver_Common $db the database driver to use for this
recordset.
@param array $set optional array of objects passed through
recursive call containing all objects that
h... | [
"Sets",
"the",
"database",
"driver",
"for",
"this",
"recordset"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBRecordsetWrapper.php#L1312-L1329 |
33,715 | silverorange/swat | SwatDB/SwatDBRecordsetWrapper.php | SwatDBRecordsetWrapper.save | public function save()
{
$this->checkDB();
$transaction = new SwatDBTransaction($this->db);
try {
foreach ($this->removed_objects as $object) {
$object->setDatabase($this->db);
$object->delete();
}
foreach ($this->objects a... | php | public function save()
{
$this->checkDB();
$transaction = new SwatDBTransaction($this->db);
try {
foreach ($this->removed_objects as $object) {
$object->setDatabase($this->db);
$object->delete();
}
foreach ($this->objects a... | [
"public",
"function",
"save",
"(",
")",
"{",
"$",
"this",
"->",
"checkDB",
"(",
")",
";",
"$",
"transaction",
"=",
"new",
"SwatDBTransaction",
"(",
"$",
"this",
"->",
"db",
")",
";",
"try",
"{",
"foreach",
"(",
"$",
"this",
"->",
"removed_objects",
"... | Saves this recordset to the database
Saving a recordset works as follows:
1. Objects that were removed are deleted from the database.
2. Objects that were added are inserted into the database,
3. Objects that were modified are updated in the database,
Deleting is performed before adding incase a new row with the same... | [
"Saves",
"this",
"recordset",
"to",
"the",
"database"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBRecordsetWrapper.php#L1346-L1369 |
33,716 | silverorange/swat | SwatDB/SwatDBRecordsetWrapper.php | SwatDBRecordsetWrapper.load | public function load($object_indexes)
{
if (!is_array($object_indexes)) {
throw new SwatInvalidTypeException(
'The $object_indexes property must be an array.',
0,
$object_indexes
);
}
$interfaces = class_implements($thi... | php | public function load($object_indexes)
{
if (!is_array($object_indexes)) {
throw new SwatInvalidTypeException(
'The $object_indexes property must be an array.',
0,
$object_indexes
);
}
$interfaces = class_implements($thi... | [
"public",
"function",
"load",
"(",
"$",
"object_indexes",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"object_indexes",
")",
")",
"{",
"throw",
"new",
"SwatInvalidTypeException",
"(",
"'The $object_indexes property must be an array.'",
",",
"0",
",",
"$",
"o... | Loads a set of records into this recordset
It is recommended for performance that you use recordset wrappers to
wrap a MDB2 result set rather than using this load() method. Using this
method performs N queries where N is the size of the passed array of
object indexes.
@param array $object_indexes the index field valu... | [
"Loads",
"a",
"set",
"of",
"records",
"into",
"this",
"recordset"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBRecordsetWrapper.php#L1396-L1447 |
33,717 | silverorange/swat | SwatDB/SwatDBRecordsetWrapper.php | SwatDBRecordsetWrapper.isModified | public function isModified()
{
if (count($this->removed_objects) > 0) {
return true;
}
foreach ($this->objects as $name => $object) {
if ($object->isModified()) {
return true;
}
}
return false;
} | php | public function isModified()
{
if (count($this->removed_objects) > 0) {
return true;
}
foreach ($this->objects as $name => $object) {
if ($object->isModified()) {
return true;
}
}
return false;
} | [
"public",
"function",
"isModified",
"(",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"removed_objects",
")",
">",
"0",
")",
"{",
"return",
"true",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"objects",
"as",
"$",
"name",
"=>",
"$",
"obje... | Returns true if this recordset has been modified since it was loaded
A recordset is considered modified if any of the contained records have
been modified or if any records have been removed from this set. Adding
an unmodified record to this set does not constitute modifying the set.
@return boolean true if this reco... | [
"Returns",
"true",
"if",
"this",
"recordset",
"has",
"been",
"modified",
"since",
"it",
"was",
"loaded"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBRecordsetWrapper.php#L1477-L1490 |
33,718 | silverorange/swat | SwatDB/SwatDBRecordsetWrapper.php | SwatDBRecordsetWrapper.setFlushableCache | public function setFlushableCache(SwatDBCacheNsFlushable $cache)
{
foreach ($this->objects as $object) {
if ($object instanceof SwatDBFlushable) {
$object->setFlushableCache($cache);
}
}
} | php | public function setFlushableCache(SwatDBCacheNsFlushable $cache)
{
foreach ($this->objects as $object) {
if ($object instanceof SwatDBFlushable) {
$object->setFlushableCache($cache);
}
}
} | [
"public",
"function",
"setFlushableCache",
"(",
"SwatDBCacheNsFlushable",
"$",
"cache",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"objects",
"as",
"$",
"object",
")",
"{",
"if",
"(",
"$",
"object",
"instanceof",
"SwatDBFlushable",
")",
"{",
"$",
"object",... | Sets the flushable cache to use for this record-set
Using a flushable cache allows clearing the cache when the records
are modified or deleted.
@param SwatDBCacheNsFlushable $cache The flushable cache to use for
this dataobject. | [
"Sets",
"the",
"flushable",
"cache",
"to",
"use",
"for",
"this",
"record",
"-",
"set"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBRecordsetWrapper.php#L1504-L1511 |
33,719 | brainworxx/kreXX | src/Analyse/Routing/Process/ProcessInteger.php | ProcessInteger.process | public function process(Model $model)
{
return $this->pool->render->renderSingleChild(
$model->setNormal($model->getData())->setType(static::TYPE_INTEGER)
);
} | php | public function process(Model $model)
{
return $this->pool->render->renderSingleChild(
$model->setNormal($model->getData())->setType(static::TYPE_INTEGER)
);
} | [
"public",
"function",
"process",
"(",
"Model",
"$",
"model",
")",
"{",
"return",
"$",
"this",
"->",
"pool",
"->",
"render",
"->",
"renderSingleChild",
"(",
"$",
"model",
"->",
"setNormal",
"(",
"$",
"model",
"->",
"getData",
"(",
")",
")",
"->",
"setTy... | Render a dump for a integer value.
@param Model $model
The data we are analysing.
@return string
The rendered markup. | [
"Render",
"a",
"dump",
"for",
"a",
"integer",
"value",
"."
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Analyse/Routing/Process/ProcessInteger.php#L56-L61 |
33,720 | silverorange/swat | SwatDB/SwatDBDataObject.php | SwatDBDataObject.getModifiedProperties | public function getModifiedProperties()
{
if ($this->read_only) {
return array();
}
$modified_properties = array();
foreach ($this->getProperties() as $name => $value) {
$hashed_value = $this->getHashValue($value);
if (
array_key_e... | php | public function getModifiedProperties()
{
if ($this->read_only) {
return array();
}
$modified_properties = array();
foreach ($this->getProperties() as $name => $value) {
$hashed_value = $this->getHashValue($value);
if (
array_key_e... | [
"public",
"function",
"getModifiedProperties",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"read_only",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"$",
"modified_properties",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getPr... | Gets a list of all the modified properties of this object
@return array an array of modified properties and their values in the
form of: name => value | [
"Gets",
"a",
"list",
"of",
"all",
"the",
"modified",
"properties",
"of",
"this",
"object"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBDataObject.php#L146-L164 |
33,721 | silverorange/swat | SwatDB/SwatDBDataObject.php | SwatDBDataObject.duplicate | public function duplicate()
{
$class = get_class($this);
$new_object = new $class();
$id_field = new SwatDBField($this->id_field, 'integer');
// public properties
$properties = array_merge(
$this->getPublicProperties(),
$this->getSerializableProtected... | php | public function duplicate()
{
$class = get_class($this);
$new_object = new $class();
$id_field = new SwatDBField($this->id_field, 'integer');
// public properties
$properties = array_merge(
$this->getPublicProperties(),
$this->getSerializableProtected... | [
"public",
"function",
"duplicate",
"(",
")",
"{",
"$",
"class",
"=",
"get_class",
"(",
"$",
"this",
")",
";",
"$",
"new_object",
"=",
"new",
"$",
"class",
"(",
")",
";",
"$",
"id_field",
"=",
"new",
"SwatDBField",
"(",
"$",
"this",
"->",
"id_field",
... | Duplicates this object
A duplicate is less of an exact copy than a true clone. Like a clone, a
duplicate has all the same public property values. Unlike a clone, a
duplicate does not have an id and therefore can be saved to the
database as a new row. This method recursively duplicates
sub-dataobjects which were regis... | [
"Duplicates",
"this",
"object"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBDataObject.php#L436-L497 |
33,722 | silverorange/swat | SwatDB/SwatDBDataObject.php | SwatDBDataObject.initFromRow | protected function initFromRow($row)
{
if ($row === null) {
throw new SwatDBException(
'Attempting to initialize dataobject with a null row.'
);
}
$property_array = array_merge(
$this->getPublicProperties(),
$this->getSerializa... | php | protected function initFromRow($row)
{
if ($row === null) {
throw new SwatDBException(
'Attempting to initialize dataobject with a null row.'
);
}
$property_array = array_merge(
$this->getPublicProperties(),
$this->getSerializa... | [
"protected",
"function",
"initFromRow",
"(",
"$",
"row",
")",
"{",
"if",
"(",
"$",
"row",
"===",
"null",
")",
"{",
"throw",
"new",
"SwatDBException",
"(",
"'Attempting to initialize dataobject with a null row.'",
")",
";",
"}",
"$",
"property_array",
"=",
"array... | Takes a data row and sets the properties of this object according to
the values of the row
Subclasses can override this method to provide additional
functionality.
@param mixed $row the row to use as either an array or object. | [
"Takes",
"a",
"data",
"row",
"and",
"sets",
"the",
"properties",
"of",
"this",
"object",
"according",
"to",
"the",
"values",
"of",
"the",
"row"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBDataObject.php#L583-L625 |
33,723 | silverorange/swat | SwatDB/SwatDBDataObject.php | SwatDBDataObject.generatePropertyHashes | protected function generatePropertyHashes()
{
if ($this->read_only) {
return;
}
// Note: SwatDBDataObject::generatePropertyHash() is not used
// here because it would mean calling the expensive getProperties()
// method in a loop.
foreach ($this->getPrope... | php | protected function generatePropertyHashes()
{
if ($this->read_only) {
return;
}
// Note: SwatDBDataObject::generatePropertyHash() is not used
// here because it would mean calling the expensive getProperties()
// method in a loop.
foreach ($this->getPrope... | [
"protected",
"function",
"generatePropertyHashes",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"read_only",
")",
"{",
"return",
";",
"}",
"// Note: SwatDBDataObject::generatePropertyHash() is not used",
"// here because it would mean calling the expensive getProperties()",
"//... | Generates the set of md5 hashes for this data object
The md5 hashes represent all the public properties of this object and
are used to tell if a property has been modified. | [
"Generates",
"the",
"set",
"of",
"md5",
"hashes",
"for",
"this",
"data",
"object"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBDataObject.php#L636-L649 |
33,724 | silverorange/swat | SwatDB/SwatDBDataObject.php | SwatDBDataObject.generatePropertyHash | protected function generatePropertyHash($property)
{
if ($this->read_only) {
return;
}
$property_array = $this->getProperties();
if (isset($property_array[$property])) {
$hashed_value = $this->getHashValue($property_array[$property]);
$this->prop... | php | protected function generatePropertyHash($property)
{
if ($this->read_only) {
return;
}
$property_array = $this->getProperties();
if (isset($property_array[$property])) {
$hashed_value = $this->getHashValue($property_array[$property]);
$this->prop... | [
"protected",
"function",
"generatePropertyHash",
"(",
"$",
"property",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"read_only",
")",
"{",
"return",
";",
"}",
"$",
"property_array",
"=",
"$",
"this",
"->",
"getProperties",
"(",
")",
";",
"if",
"(",
"isset",
... | Generates the MD5 hash for a property of this object
@param string $property the name of the property for which to generate
the hash. | [
"Generates",
"the",
"MD5",
"hash",
"for",
"a",
"property",
"of",
"this",
"object"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBDataObject.php#L660-L672 |
33,725 | silverorange/swat | SwatDB/SwatDBDataObject.php | SwatDBDataObject.getPublicProperties | private function getPublicProperties()
{
$class = get_class($this);
// cache class public property names since reflection is expensive
if (!array_key_exists($class, self::$public_properties_cache)) {
$public_properties = array();
$reflector = new ReflectionClass($cl... | php | private function getPublicProperties()
{
$class = get_class($this);
// cache class public property names since reflection is expensive
if (!array_key_exists($class, self::$public_properties_cache)) {
$public_properties = array();
$reflector = new ReflectionClass($cl... | [
"private",
"function",
"getPublicProperties",
"(",
")",
"{",
"$",
"class",
"=",
"get_class",
"(",
"$",
"this",
")",
";",
"// cache class public property names since reflection is expensive",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"class",
",",
"self",
"::",
... | Gets the public properties of this data-object
Public properties should correspond directly to database fields.
@return array a reference to an associative array of public properties
of this data-object. The array is of the form
'property name' => 'property value'. | [
"Gets",
"the",
"public",
"properties",
"of",
"this",
"data",
"-",
"object"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBDataObject.php#L802-L828 |
33,726 | silverorange/swat | SwatDB/SwatDBDataObject.php | SwatDBDataObject.getSerializableProtectedProperties | private function getSerializableProtectedProperties()
{
$properties = array();
foreach ($this->getProtectedPropertyList() as $property => $accessors) {
// We want to maintain what is internally stored in this object so
// we don't want to use the getter. What the getter retur... | php | private function getSerializableProtectedProperties()
{
$properties = array();
foreach ($this->getProtectedPropertyList() as $property => $accessors) {
// We want to maintain what is internally stored in this object so
// we don't want to use the getter. What the getter retur... | [
"private",
"function",
"getSerializableProtectedProperties",
"(",
")",
"{",
"$",
"properties",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getProtectedPropertyList",
"(",
")",
"as",
"$",
"property",
"=>",
"$",
"accessors",
")",
"{",
"// ... | Gets the serializable protected properties of this data-object.
Protected properties should correspond directly to database fields.
@return array a reference to an associative array of protected properties
of this data-object. The array is of the form
'property name' => 'property value'. | [
"Gets",
"the",
"serializable",
"protected",
"properties",
"of",
"this",
"data",
"-",
"object",
"."
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBDataObject.php#L842-L853 |
33,727 | silverorange/swat | SwatDB/SwatDBDataObject.php | SwatDBDataObject.getProtectedProperties | private function getProtectedProperties()
{
$properties = array();
foreach ($this->getProtectedPropertyList() as $property => $accessors) {
// Use the getter for the property.
$properties[$property] = $this->{$accessors['get']}();
}
return $properties;
} | php | private function getProtectedProperties()
{
$properties = array();
foreach ($this->getProtectedPropertyList() as $property => $accessors) {
// Use the getter for the property.
$properties[$property] = $this->{$accessors['get']}();
}
return $properties;
} | [
"private",
"function",
"getProtectedProperties",
"(",
")",
"{",
"$",
"properties",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getProtectedPropertyList",
"(",
")",
"as",
"$",
"property",
"=>",
"$",
"accessors",
")",
"{",
"// Use the gett... | Gets the protected properties of this data-object using the getter
accessor.
Protected properties should correspond directly to database fields.
@return array a reference to an associative array of protected properties
of this data-object. The array is of the form
'property name' => 'property value'. | [
"Gets",
"the",
"protected",
"properties",
"of",
"this",
"data",
"-",
"object",
"using",
"the",
"getter",
"accessor",
"."
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBDataObject.php#L868-L877 |
33,728 | silverorange/swat | SwatDB/SwatDBDataObject.php | SwatDBDataObject.& | private function &getProperties()
{
$property_array = array_merge(
$this->getPublicProperties(),
$this->getSerializableProtectedProperties(),
$this->internal_properties
);
return $property_array;
} | php | private function &getProperties()
{
$property_array = array_merge(
$this->getPublicProperties(),
$this->getSerializableProtectedProperties(),
$this->internal_properties
);
return $property_array;
} | [
"private",
"function",
"&",
"getProperties",
"(",
")",
"{",
"$",
"property_array",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"getPublicProperties",
"(",
")",
",",
"$",
"this",
"->",
"getSerializableProtectedProperties",
"(",
")",
",",
"$",
"this",
"->",
"i... | Gets all the modifyable properties of this data-object
This includes the public and protected properties that correspond to
database fields and the internal values that also correspond to database
fields.
@return array a reference to an associative array of properties of this
data-object. The array is of the form
'pr... | [
"Gets",
"all",
"the",
"modifyable",
"properties",
"of",
"this",
"data",
"-",
"object"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBDataObject.php#L893-L902 |
33,729 | silverorange/swat | SwatDB/SwatDBDataObject.php | SwatDBDataObject.isModified | public function isModified()
{
if ($this->read_only) {
return false;
}
foreach ($this->getProperties() as $name => $value) {
$hashed_value = $this->getHashValue($value);
if (
isset($this->property_hashes[$name]) &&
$hashed_... | php | public function isModified()
{
if ($this->read_only) {
return false;
}
foreach ($this->getProperties() as $name => $value) {
$hashed_value = $this->getHashValue($value);
if (
isset($this->property_hashes[$name]) &&
$hashed_... | [
"public",
"function",
"isModified",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"read_only",
")",
"{",
"return",
"false",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"getProperties",
"(",
")",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"$",... | Returns true if this object has been modified since it was loaded
@return boolean true if this object was modified and false if this
object was not modified. | [
"Returns",
"true",
"if",
"this",
"object",
"has",
"been",
"modified",
"since",
"it",
"was",
"loaded"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBDataObject.php#L1144-L1188 |
33,730 | silverorange/swat | SwatDB/SwatDBDataObject.php | SwatDBDataObject.saveNewBinding | protected function saveNewBinding()
{
$modified_properties = $this->getModifiedProperties();
if (count($modified_properties) === 0) {
return;
}
$fields = array();
$values = array();
foreach ($this->getModifiedProperties() as $name => $value) {
... | php | protected function saveNewBinding()
{
$modified_properties = $this->getModifiedProperties();
if (count($modified_properties) === 0) {
return;
}
$fields = array();
$values = array();
foreach ($this->getModifiedProperties() as $name => $value) {
... | [
"protected",
"function",
"saveNewBinding",
"(",
")",
"{",
"$",
"modified_properties",
"=",
"$",
"this",
"->",
"getModifiedProperties",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"modified_properties",
")",
"===",
"0",
")",
"{",
"return",
";",
"}",
"$",
... | Saves a new binding object without an id to the database
Only modified properties are saved. It is always inserted,
never updated. | [
"Saves",
"a",
"new",
"binding",
"object",
"without",
"an",
"id",
"to",
"the",
"database"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBDataObject.php#L1429-L1448 |
33,731 | silverorange/swat | SwatDB/SwatDBDataObject.php | SwatDBDataObject.flushCacheNamespaces | public function flushCacheNamespaces($ns_array = null)
{
if ($ns_array === null) {
$ns_array = $this->getCacheNamespaces();
}
if ($this->flushable_cache instanceof SwatDBCacheNsFlushable) {
$ns_array = array_unique($ns_array);
foreach ($ns_array as $ns) {... | php | public function flushCacheNamespaces($ns_array = null)
{
if ($ns_array === null) {
$ns_array = $this->getCacheNamespaces();
}
if ($this->flushable_cache instanceof SwatDBCacheNsFlushable) {
$ns_array = array_unique($ns_array);
foreach ($ns_array as $ns) {... | [
"public",
"function",
"flushCacheNamespaces",
"(",
"$",
"ns_array",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"ns_array",
"===",
"null",
")",
"{",
"$",
"ns_array",
"=",
"$",
"this",
"->",
"getCacheNamespaces",
"(",
")",
";",
"}",
"if",
"(",
"$",
"this",
... | Flushes the cache name-spaces for this object.
@param array $ns_array An optional array of name-spaces to flush.
If no name-spaces are specified,
{@link SwatDBDataObject::getCacheNamespaces()} is
used to get the array of name-spaces.
@see SwatDBDataObject::setFlushableCache()
@see SwatDBDataObject::getCacheNamespaces... | [
"Flushes",
"the",
"cache",
"name",
"-",
"spaces",
"for",
"this",
"object",
"."
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/SwatDB/SwatDBDataObject.php#L1544-L1556 |
33,732 | honey-comb/core | src/Http/Controllers/HCBaseController.php | HCBaseController.getUserActions | protected function getUserActions(string $prefix, array $except = []): array
{
$actions = [];
if (!in_array('_search', $except)) {
$actions[] = 'search';
}
if (!in_array('_create', $except) && auth()->user()->can($prefix . '_create')) {
$actions[] = 'new';
... | php | protected function getUserActions(string $prefix, array $except = []): array
{
$actions = [];
if (!in_array('_search', $except)) {
$actions[] = 'search';
}
if (!in_array('_create', $except) && auth()->user()->can($prefix . '_create')) {
$actions[] = 'new';
... | [
"protected",
"function",
"getUserActions",
"(",
"string",
"$",
"prefix",
",",
"array",
"$",
"except",
"=",
"[",
"]",
")",
":",
"array",
"{",
"$",
"actions",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"in_array",
"(",
"'_search'",
",",
"$",
"except",
")",
... | Getting allowed actions for admin view
@param string $prefix
@param array $except
@return array
@throws \Illuminate\Contracts\Container\BindingResolutionException | [
"Getting",
"allowed",
"actions",
"for",
"admin",
"view"
] | 5c12aba31cae092e9681f0ae3e3664ed3fcec956 | https://github.com/honey-comb/core/blob/5c12aba31cae092e9681f0ae3e3664ed3fcec956/src/Http/Controllers/HCBaseController.php#L59-L96 |
33,733 | brainworxx/kreXX | src/Analyse/Callback/Iterate/ThroughConstants.php | ThroughConstants.callMe | public function callMe()
{
$output = $this->dispatchStartEvent();
// We do not need to check the recursionHandler, this is class
// internal stuff. Is it even possible to create a recursion here?
// Iterate through.
foreach ($this->parameters[static::PARAM_DATA] as $k => &$v... | php | public function callMe()
{
$output = $this->dispatchStartEvent();
// We do not need to check the recursionHandler, this is class
// internal stuff. Is it even possible to create a recursion here?
// Iterate through.
foreach ($this->parameters[static::PARAM_DATA] as $k => &$v... | [
"public",
"function",
"callMe",
"(",
")",
"{",
"$",
"output",
"=",
"$",
"this",
"->",
"dispatchStartEvent",
"(",
")",
";",
"// We do not need to check the recursionHandler, this is class",
"// internal stuff. Is it even possible to create a recursion here?",
"// Iterate through."... | Simply iterate though object constants.
@return string
The generated markup. | [
"Simply",
"iterate",
"though",
"object",
"constants",
"."
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Analyse/Callback/Iterate/ThroughConstants.php#L62-L79 |
33,734 | silverorange/swat | Swat/SwatCheckboxList.php | SwatCheckboxList.init | public function init()
{
parent::init();
// checks to see if there are duplicate values in the options array
$options_count = array();
foreach ($this->getOptions() as $option) {
$options_count[] = $option->value;
}
foreach (array_count_values($options_co... | php | public function init()
{
parent::init();
// checks to see if there are duplicate values in the options array
$options_count = array();
foreach ($this->getOptions() as $option) {
$options_count[] = $option->value;
}
foreach (array_count_values($options_co... | [
"public",
"function",
"init",
"(",
")",
"{",
"parent",
"::",
"init",
"(",
")",
";",
"// checks to see if there are duplicate values in the options array",
"$",
"options_count",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getOptions",
"(",
")... | Initializes this checkbox list
@throws SwatException if there are duplicate values in the options array | [
"Initializes",
"this",
"checkbox",
"list"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatCheckboxList.php#L83-L100 |
33,735 | silverorange/swat | Swat/SwatCheckboxList.php | SwatCheckboxList.process | public function process()
{
if (!$this->getForm()->isSubmitted()) {
return;
}
parent::process();
$this->processValues();
if (
$this->required &&
count($this->values) == 0 &&
$this->isSensitive()
) {
$this-... | php | public function process()
{
if (!$this->getForm()->isSubmitted()) {
return;
}
parent::process();
$this->processValues();
if (
$this->required &&
count($this->values) == 0 &&
$this->isSensitive()
) {
$this-... | [
"public",
"function",
"process",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getForm",
"(",
")",
"->",
"isSubmitted",
"(",
")",
")",
"{",
"return",
";",
"}",
"parent",
"::",
"process",
"(",
")",
";",
"$",
"this",
"->",
"processValues",
"(",
... | Processes this checkbox list widget | [
"Processes",
"this",
"checkbox",
"list",
"widget"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatCheckboxList.php#L197-L214 |
33,736 | silverorange/swat | Swat/SwatCheckboxList.php | SwatCheckboxList.processValues | protected function processValues()
{
$form = $this->getForm();
$data = &$form->getFormData();
if (isset($data[$this->id])) {
if (is_array($data[$this->id])) {
$this->values = $data[$this->id];
} elseif ($data[$this->id] != '') {
$this-... | php | protected function processValues()
{
$form = $this->getForm();
$data = &$form->getFormData();
if (isset($data[$this->id])) {
if (is_array($data[$this->id])) {
$this->values = $data[$this->id];
} elseif ($data[$this->id] != '') {
$this-... | [
"protected",
"function",
"processValues",
"(",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"getForm",
"(",
")",
";",
"$",
"data",
"=",
"&",
"$",
"form",
"->",
"getFormData",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"$",
"this"... | Processes the values of this checkbox list from raw form data | [
"Processes",
"the",
"values",
"of",
"this",
"checkbox",
"list",
"from",
"raw",
"form",
"data"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatCheckboxList.php#L266-L282 |
33,737 | silverorange/swat | Swat/SwatCheckboxList.php | SwatCheckboxList.displayOption | protected function displayOption(SwatOption $option, $index)
{
$input_tag = new SwatHtmlTag('input');
$input_tag->type = 'checkbox';
$input_tag->name = $this->id . '[' . $index . ']';
$input_tag->value = (string) $option->value;
$input_tag->id = $this->id . '_' . $index;
... | php | protected function displayOption(SwatOption $option, $index)
{
$input_tag = new SwatHtmlTag('input');
$input_tag->type = 'checkbox';
$input_tag->name = $this->id . '[' . $index . ']';
$input_tag->value = (string) $option->value;
$input_tag->id = $this->id . '_' . $index;
... | [
"protected",
"function",
"displayOption",
"(",
"SwatOption",
"$",
"option",
",",
"$",
"index",
")",
"{",
"$",
"input_tag",
"=",
"new",
"SwatHtmlTag",
"(",
"'input'",
")",
";",
"$",
"input_tag",
"->",
"type",
"=",
"'checkbox'",
";",
"$",
"input_tag",
"->",
... | Helper method to display a single option of this checkbox list
@param SwatOption $option the option to display.
@param integer $index a numeric index indicating which option is being
displayed. Starts as 0. | [
"Helper",
"method",
"to",
"display",
"a",
"single",
"option",
"of",
"this",
"checkbox",
"list"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatCheckboxList.php#L294-L320 |
33,738 | silverorange/swat | Swat/SwatCheckboxList.php | SwatCheckboxList.getInlineJavaScript | protected function getInlineJavaScript()
{
$javascript = sprintf(
'var %s_obj = new %s(%s);',
$this->id,
$this->getJavaScriptClassName(),
SwatString::quoteJavaScriptString($this->id)
);
// set check-all controller if it is visible
$che... | php | protected function getInlineJavaScript()
{
$javascript = sprintf(
'var %s_obj = new %s(%s);',
$this->id,
$this->getJavaScriptClassName(),
SwatString::quoteJavaScriptString($this->id)
);
// set check-all controller if it is visible
$che... | [
"protected",
"function",
"getInlineJavaScript",
"(",
")",
"{",
"$",
"javascript",
"=",
"sprintf",
"(",
"'var %s_obj = new %s(%s);'",
",",
"$",
"this",
"->",
"id",
",",
"$",
"this",
"->",
"getJavaScriptClassName",
"(",
")",
",",
"SwatString",
"::",
"quoteJavaScri... | Gets the inline JavaScript for this checkbox list
@return string the inline JavaScript for this checkbox list. | [
"Gets",
"the",
"inline",
"JavaScript",
"for",
"this",
"checkbox",
"list"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatCheckboxList.php#L379-L399 |
33,739 | silverorange/swat | Swat/SwatWidgetCellRenderer.php | SwatWidgetCellRenderer.init | public function init()
{
$replicators = null;
$form = $this->getForm();
if ($form !== null && $form->isSubmitted()) {
$replicators = $form->getHiddenField(
$this->getReplicatorFieldName()
);
if ($replicators !== null) {
fo... | php | public function init()
{
$replicators = null;
$form = $this->getForm();
if ($form !== null && $form->isSubmitted()) {
$replicators = $form->getHiddenField(
$this->getReplicatorFieldName()
);
if ($replicators !== null) {
fo... | [
"public",
"function",
"init",
"(",
")",
"{",
"$",
"replicators",
"=",
"null",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"getForm",
"(",
")",
";",
"if",
"(",
"$",
"form",
"!==",
"null",
"&&",
"$",
"form",
"->",
"isSubmitted",
"(",
")",
")",
"{",
... | Initializes this cell renderer
This calls {@link SwatWidget::init()} on this renderer's widget. | [
"Initializes",
"this",
"cell",
"renderer"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatWidgetCellRenderer.php#L140-L160 |
33,740 | silverorange/swat | Swat/SwatWidgetCellRenderer.php | SwatWidgetCellRenderer.getWidget | public function getWidget($replicator_id, $widget_id = null)
{
$widget = null;
if ($widget_id === null) {
if (isset($this->widgets[$replicator_id])) {
$widget = current($this->widgets[$replicator_id]);
}
} else {
if (isset($this->widgets[$... | php | public function getWidget($replicator_id, $widget_id = null)
{
$widget = null;
if ($widget_id === null) {
if (isset($this->widgets[$replicator_id])) {
$widget = current($this->widgets[$replicator_id]);
}
} else {
if (isset($this->widgets[$... | [
"public",
"function",
"getWidget",
"(",
"$",
"replicator_id",
",",
"$",
"widget_id",
"=",
"null",
")",
"{",
"$",
"widget",
"=",
"null",
";",
"if",
"(",
"$",
"widget_id",
"===",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"widgets",
... | Retrieves a reference to a replicated widget
@param string $replicator_id the replicator id of the replicated widget
@param string $widget_id the unique id of the original widget, or null
to get the root
@return SwatWidget a reference to the replicated widget, or null if the
widget is not found. | [
"Retrieves",
"a",
"reference",
"to",
"a",
"replicated",
"widget"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatWidgetCellRenderer.php#L308-L323 |
33,741 | silverorange/swat | Swat/SwatWidgetCellRenderer.php | SwatWidgetCellRenderer.getWidgets | public function getWidgets($widget_id = null)
{
$form = $this->getForm();
if ($form !== null && $form->isSubmitted()) {
$replicators = $form->getHiddenField(
$this->getReplicatorFieldName()
);
$widgets = array();
if (is_array($replicat... | php | public function getWidgets($widget_id = null)
{
$form = $this->getForm();
if ($form !== null && $form->isSubmitted()) {
$replicators = $form->getHiddenField(
$this->getReplicatorFieldName()
);
$widgets = array();
if (is_array($replicat... | [
"public",
"function",
"getWidgets",
"(",
"$",
"widget_id",
"=",
"null",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"getForm",
"(",
")",
";",
"if",
"(",
"$",
"form",
"!==",
"null",
"&&",
"$",
"form",
"->",
"isSubmitted",
"(",
")",
")",
"{",
"$... | Gets an array of replicated widgets indexed by the replicator_id
If this cell renderer's form is submitted, only cloned widgets that were
displayed and processed are returned.
@param string $widget_id the unique id of the original widget, or null
to get the root
@return array an array of widgets indexed by replicato... | [
"Gets",
"an",
"array",
"of",
"replicated",
"widgets",
"indexed",
"by",
"the",
"replicator_id"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatWidgetCellRenderer.php#L342-L382 |
33,742 | silverorange/swat | Swat/SwatWidgetCellRenderer.php | SwatWidgetCellRenderer.& | public function &getClonedWidgets()
{
$form = $this->getForm();
if ($form !== null && $form->isSubmitted()) {
$replicators = $form->getHiddenField(
$this->getReplicatorFieldName()
);
$clones = array();
foreach ($this->clones as $replic... | php | public function &getClonedWidgets()
{
$form = $this->getForm();
if ($form !== null && $form->isSubmitted()) {
$replicators = $form->getHiddenField(
$this->getReplicatorFieldName()
);
$clones = array();
foreach ($this->clones as $replic... | [
"public",
"function",
"&",
"getClonedWidgets",
"(",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"getForm",
"(",
")",
";",
"if",
"(",
"$",
"form",
"!==",
"null",
"&&",
"$",
"form",
"->",
"isSubmitted",
"(",
")",
")",
"{",
"$",
"replicators",
"=",... | Gets an array of cloned widgets indexed by the replicator_id
If this cell renderer's form is submitted, only cloned widgets that were
displayed and processed are returned.
@deprecated Use {@link SwatWidgetCellRenderer::getWidgets()} instead.
Pass null to getWidgets() for the same output as this
method.
@return array... | [
"Gets",
"an",
"array",
"of",
"cloned",
"widgets",
"indexed",
"by",
"the",
"replicator_id"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatWidgetCellRenderer.php#L399-L421 |
33,743 | silverorange/swat | Swat/SwatWidgetCellRenderer.php | SwatWidgetCellRenderer.getDataSpecificCSSClassNames | public function getDataSpecificCSSClassNames()
{
$classes = array();
if (
$this->replicator_id !== null &&
$this->hasMessage($this->replicator_id)
) {
$classes[] = 'swat-error';
}
return $classes;
} | php | public function getDataSpecificCSSClassNames()
{
$classes = array();
if (
$this->replicator_id !== null &&
$this->hasMessage($this->replicator_id)
) {
$classes[] = 'swat-error';
}
return $classes;
} | [
"public",
"function",
"getDataSpecificCSSClassNames",
"(",
")",
"{",
"$",
"classes",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"replicator_id",
"!==",
"null",
"&&",
"$",
"this",
"->",
"hasMessage",
"(",
"$",
"this",
"->",
"replicator_id",
... | Gets the data specific CSS class names for this widget cell renderer
If the widget within this cell renderer has messages, a CSS class of
'swat-error' is added to the base CSS classes of this cell renderer.
@return array the array of data specific CSS class names for this widget
cell-renderer. | [
"Gets",
"the",
"data",
"specific",
"CSS",
"class",
"names",
"for",
"this",
"widget",
"cell",
"renderer"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatWidgetCellRenderer.php#L435-L447 |
33,744 | silverorange/swat | Swat/SwatWidgetCellRenderer.php | SwatWidgetCellRenderer.getMessages | public function getMessages($replicator_id = null)
{
$messages = array();
if ($replicator_id !== null) {
$messages = $this->getClonedWidget($replicator_id)->getMessages();
} elseif ($this->replicator_id !== null) {
$messages = $this->getClonedWidget(
... | php | public function getMessages($replicator_id = null)
{
$messages = array();
if ($replicator_id !== null) {
$messages = $this->getClonedWidget($replicator_id)->getMessages();
} elseif ($this->replicator_id !== null) {
$messages = $this->getClonedWidget(
... | [
"public",
"function",
"getMessages",
"(",
"$",
"replicator_id",
"=",
"null",
")",
"{",
"$",
"messages",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"replicator_id",
"!==",
"null",
")",
"{",
"$",
"messages",
"=",
"$",
"this",
"->",
"getClonedWidget",
"... | Gathers all messages from the widget of this cell renderer for the given
replicator id
@param mixed $replicator_id an optional replicator id of the row to
gather messages from. If no replicator id
is specified, the current replicator_id is
used.
@return array an array of {@link SwatMessage} objects. | [
"Gathers",
"all",
"messages",
"from",
"the",
"widget",
"of",
"this",
"cell",
"renderer",
"for",
"the",
"given",
"replicator",
"id"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatWidgetCellRenderer.php#L463-L476 |
33,745 | silverorange/swat | Swat/SwatWidgetCellRenderer.php | SwatWidgetCellRenderer.hasMessage | public function hasMessage($replicator_id = null)
{
$has_message = false;
if ($replicator_id !== null) {
$has_message = $this->getClonedWidget($replicator_id)->hasMessage();
} elseif ($this->replicator_id !== null) {
$has_message = $this->getClonedWidget(
... | php | public function hasMessage($replicator_id = null)
{
$has_message = false;
if ($replicator_id !== null) {
$has_message = $this->getClonedWidget($replicator_id)->hasMessage();
} elseif ($this->replicator_id !== null) {
$has_message = $this->getClonedWidget(
... | [
"public",
"function",
"hasMessage",
"(",
"$",
"replicator_id",
"=",
"null",
")",
"{",
"$",
"has_message",
"=",
"false",
";",
"if",
"(",
"$",
"replicator_id",
"!==",
"null",
")",
"{",
"$",
"has_message",
"=",
"$",
"this",
"->",
"getClonedWidget",
"(",
"$"... | Gets whether or not this widget cell renderer has messages
@param mixed $replicator_id an optional replicator id of the row to
check for messages. If no replicator id is
specified, the current replicator_id is
used.
@return boolean true if this widget cell renderer has one or more
messages for the given replicator id... | [
"Gets",
"whether",
"or",
"not",
"this",
"widget",
"cell",
"renderer",
"has",
"messages"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatWidgetCellRenderer.php#L493-L506 |
33,746 | silverorange/swat | Swat/SwatWidgetCellRenderer.php | SwatWidgetCellRenderer.getTitle | public function getTitle()
{
$title = null;
if (isset($this->parent->title)) {
$title = $this->parent->title;
}
return $title;
} | php | public function getTitle()
{
$title = null;
if (isset($this->parent->title)) {
$title = $this->parent->title;
}
return $title;
} | [
"public",
"function",
"getTitle",
"(",
")",
"{",
"$",
"title",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"parent",
"->",
"title",
")",
")",
"{",
"$",
"title",
"=",
"$",
"this",
"->",
"parent",
"->",
"title",
";",
"}",
"return"... | Gets the title of this widget cell renderer
The title is taken from this cell renderer's parent.
Satisfies the {SwatTitleable::getTitle()} interface.
@return string the title of this widget cell renderer. | [
"Gets",
"the",
"title",
"of",
"this",
"widget",
"cell",
"renderer"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatWidgetCellRenderer.php#L519-L528 |
33,747 | silverorange/swat | Swat/SwatWidgetCellRenderer.php | SwatWidgetCellRenderer.getTitleContentType | public function getTitleContentType()
{
$title_content_type = 'text/plain';
if (isset($this->parent->title_content_type)) {
$title_content_type = $this->parent->title_content_type;
}
return $title_content_type;
} | php | public function getTitleContentType()
{
$title_content_type = 'text/plain';
if (isset($this->parent->title_content_type)) {
$title_content_type = $this->parent->title_content_type;
}
return $title_content_type;
} | [
"public",
"function",
"getTitleContentType",
"(",
")",
"{",
"$",
"title_content_type",
"=",
"'text/plain'",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"parent",
"->",
"title_content_type",
")",
")",
"{",
"$",
"title_content_type",
"=",
"$",
"this",
"->... | Gets the title content-type of this widget cell renderer
Implements the {@link SwatTitleable::getTitleContentType()} interface.
@return string the title content-type of this widget cell renderer. | [
"Gets",
"the",
"title",
"content",
"-",
"type",
"of",
"this",
"widget",
"cell",
"renderer"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatWidgetCellRenderer.php#L540-L549 |
33,748 | silverorange/swat | Swat/SwatWidgetCellRenderer.php | SwatWidgetCellRenderer.getHtmlHeadEntrySet | public function getHtmlHeadEntrySet()
{
$set = parent::getHtmlHeadEntrySet();
if ($this->using_null_replication) {
$set->addEntrySet(
$this->getPrototypeWidget()->getHtmlHeadEntrySet()
);
} else {
$widgets = $this->getWidgets();
... | php | public function getHtmlHeadEntrySet()
{
$set = parent::getHtmlHeadEntrySet();
if ($this->using_null_replication) {
$set->addEntrySet(
$this->getPrototypeWidget()->getHtmlHeadEntrySet()
);
} else {
$widgets = $this->getWidgets();
... | [
"public",
"function",
"getHtmlHeadEntrySet",
"(",
")",
"{",
"$",
"set",
"=",
"parent",
"::",
"getHtmlHeadEntrySet",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"using_null_replication",
")",
"{",
"$",
"set",
"->",
"addEntrySet",
"(",
"$",
"this",
"->",
... | Gets the SwatHtmlHeadEntry objects needed by this widget cell renderer
@return SwatHtmlHeadEntrySet the SwatHtmlHeadEntry objects needed by
this widget cell renderer.
@see SwatUIObject::getHtmlHeadEntrySet() | [
"Gets",
"the",
"SwatHtmlHeadEntry",
"objects",
"needed",
"by",
"this",
"widget",
"cell",
"renderer"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatWidgetCellRenderer.php#L562-L578 |
33,749 | silverorange/swat | Swat/SwatWidgetCellRenderer.php | SwatWidgetCellRenderer.getAvailableHtmlHeadEntrySet | public function getAvailableHtmlHeadEntrySet()
{
$set = parent::getAvailableHtmlHeadEntrySet();
if ($this->using_null_replication) {
$set->addEntrySet(
$this->getPrototypeWidget()->getAvailableHtmlHeadEntrySet()
);
} else {
$widgets = $thi... | php | public function getAvailableHtmlHeadEntrySet()
{
$set = parent::getAvailableHtmlHeadEntrySet();
if ($this->using_null_replication) {
$set->addEntrySet(
$this->getPrototypeWidget()->getAvailableHtmlHeadEntrySet()
);
} else {
$widgets = $thi... | [
"public",
"function",
"getAvailableHtmlHeadEntrySet",
"(",
")",
"{",
"$",
"set",
"=",
"parent",
"::",
"getAvailableHtmlHeadEntrySet",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"using_null_replication",
")",
"{",
"$",
"set",
"->",
"addEntrySet",
"(",
"$",
... | Gets the SwatHtmlHeadEntry objects that may be needed by this widget
cell renderer
@return SwatHtmlHeadEntrySet the SwatHtmlHeadEntry objects that may be
needed by this widget cell renderer.
@see SwatUIObject::getAvailableHtmlHeadEntrySet() | [
"Gets",
"the",
"SwatHtmlHeadEntry",
"objects",
"that",
"may",
"be",
"needed",
"by",
"this",
"widget",
"cell",
"renderer"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatWidgetCellRenderer.php#L592-L608 |
33,750 | silverorange/swat | Swat/SwatContentBlock.php | SwatContentBlock.display | public function display()
{
if (!$this->visible) {
return;
}
parent::display();
if ($this->content_type === 'text/plain') {
echo SwatString::minimizeEntities($this->content);
} else {
echo $this->content;
}
} | php | public function display()
{
if (!$this->visible) {
return;
}
parent::display();
if ($this->content_type === 'text/plain') {
echo SwatString::minimizeEntities($this->content);
} else {
echo $this->content;
}
} | [
"public",
"function",
"display",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"visible",
")",
"{",
"return",
";",
"}",
"parent",
"::",
"display",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"content_type",
"===",
"'text/plain'",
")",
"{",
"ec... | Displays this content
Merely performs an echo of the content. | [
"Displays",
"this",
"content"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatContentBlock.php#L38-L51 |
33,751 | brainworxx/kreXX | src/Controller/EditSettingsController.php | EditSettingsController.editSettingsAction | public function editSettingsAction()
{
if ($this->pool->emergencyHandler->checkMaxCall() === true) {
// Called too often, we might get into trouble here!
return $this;
}
$this->pool->reset();
// We will not check this for the cookie config, to avoid people l... | php | public function editSettingsAction()
{
if ($this->pool->emergencyHandler->checkMaxCall() === true) {
// Called too often, we might get into trouble here!
return $this;
}
$this->pool->reset();
// We will not check this for the cookie config, to avoid people l... | [
"public",
"function",
"editSettingsAction",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"pool",
"->",
"emergencyHandler",
"->",
"checkMaxCall",
"(",
")",
"===",
"true",
")",
"{",
"// Called too often, we might get into trouble here!",
"return",
"$",
"this",
";",
... | Outputs the edit settings dialog, without any analysis.
@return $this
Return $this for chaining | [
"Outputs",
"the",
"edit",
"settings",
"dialog",
"without",
"any",
"analysis",
"."
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Controller/EditSettingsController.php#L50-L78 |
33,752 | brainworxx/kreXX | src/Controller/AbstractController.php | AbstractController.outputFooter | protected function outputFooter(array $caller, $isExpanded = false)
{
// Now we need to stitch together the content of the ini file
// as well as it's path.
$pathToIni = $this->pool->config->getPathToIniFile();
if ($this->pool->fileService->fileIsReadable($pathToIni) === true) {
... | php | protected function outputFooter(array $caller, $isExpanded = false)
{
// Now we need to stitch together the content of the ini file
// as well as it's path.
$pathToIni = $this->pool->config->getPathToIniFile();
if ($this->pool->fileService->fileIsReadable($pathToIni) === true) {
... | [
"protected",
"function",
"outputFooter",
"(",
"array",
"$",
"caller",
",",
"$",
"isExpanded",
"=",
"false",
")",
"{",
"// Now we need to stitch together the content of the ini file",
"// as well as it's path.",
"$",
"pathToIni",
"=",
"$",
"this",
"->",
"pool",
"->",
"... | Simply renders the footer and output current settings.
@param array $caller
Where was kreXX initially invoked from.
@param boolean $isExpanded
Are we rendering an expanded footer?
TRUE when we render the settings menu only.
@return string
The generated markup. | [
"Simply",
"renders",
"the",
"footer",
"and",
"output",
"current",
"settings",
"."
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Controller/AbstractController.php#L162-L188 |
33,753 | brainworxx/kreXX | src/Controller/AbstractController.php | AbstractController.outputCssAndJs | protected function outputCssAndJs()
{
// We only do this once per output type.
$result = isset(static::$jsCssSend[$this->destination]);
static::$jsCssSend[$this->destination] = true;
if ($result === true) {
// Been here, done that.
return '';
}
... | php | protected function outputCssAndJs()
{
// We only do this once per output type.
$result = isset(static::$jsCssSend[$this->destination]);
static::$jsCssSend[$this->destination] = true;
if ($result === true) {
// Been here, done that.
return '';
}
... | [
"protected",
"function",
"outputCssAndJs",
"(",
")",
"{",
"// We only do this once per output type.",
"$",
"result",
"=",
"isset",
"(",
"static",
"::",
"$",
"jsCssSend",
"[",
"$",
"this",
"->",
"destination",
"]",
")",
";",
"static",
"::",
"$",
"jsCssSend",
"[... | Outputs the CSS and JS.
@return string
The generated markup. | [
"Outputs",
"the",
"CSS",
"and",
"JS",
"."
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Controller/AbstractController.php#L196-L229 |
33,754 | brainworxx/kreXX | src/Controller/AbstractController.php | AbstractController.noFatalForKrexx | public function noFatalForKrexx()
{
if ($this->fatalShouldActive === true) {
$this::$krexxFatal->setIsActive(false);
unregister_tick_function(array($this::$krexxFatal, 'tickCallback'));
}
return $this;
} | php | public function noFatalForKrexx()
{
if ($this->fatalShouldActive === true) {
$this::$krexxFatal->setIsActive(false);
unregister_tick_function(array($this::$krexxFatal, 'tickCallback'));
}
return $this;
} | [
"public",
"function",
"noFatalForKrexx",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"fatalShouldActive",
"===",
"true",
")",
"{",
"$",
"this",
"::",
"$",
"krexxFatal",
"->",
"setIsActive",
"(",
"false",
")",
";",
"unregister_tick_function",
"(",
"array",
... | Disables the fatal handler and the tick callback.
We disable the tick callback and the error handler during
a analysis, to generate faster output. We also disable
other kreXX calls, which may be caused by the debug callbacks
to prevent kreXX from starting other kreXX calls.
@return $this
Return $this for chaining. | [
"Disables",
"the",
"fatal",
"handler",
"and",
"the",
"tick",
"callback",
"."
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Controller/AbstractController.php#L242-L250 |
33,755 | brainworxx/kreXX | src/Controller/AbstractController.php | AbstractController.reFatalAfterKrexx | public function reFatalAfterKrexx()
{
if ($this->fatalShouldActive === true) {
$this::$krexxFatal->setIsActive(true);
register_tick_function(array($this::$krexxFatal, 'tickCallback'));
}
return $this;
} | php | public function reFatalAfterKrexx()
{
if ($this->fatalShouldActive === true) {
$this::$krexxFatal->setIsActive(true);
register_tick_function(array($this::$krexxFatal, 'tickCallback'));
}
return $this;
} | [
"public",
"function",
"reFatalAfterKrexx",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"fatalShouldActive",
"===",
"true",
")",
"{",
"$",
"this",
"::",
"$",
"krexxFatal",
"->",
"setIsActive",
"(",
"true",
")",
";",
"register_tick_function",
"(",
"array",
... | Re-enable the fatal handler and the tick callback.
We disable the tick callback and the error handler during
a analysis, to generate faster output. We re-enable kreXX
afterwards, so the dev can use it again.
@return $this
Return $this for chaining. | [
"Re",
"-",
"enable",
"the",
"fatal",
"handler",
"and",
"the",
"tick",
"callback",
"."
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Controller/AbstractController.php#L262-L270 |
33,756 | brainworxx/kreXX | src/Analyse/Routing/Process/ProcessArray.php | ProcessArray.process | public function process(Model $model)
{
$multiline = false;
$count = count($model->getData());
if ($count > (int) $this->pool->config->getSetting(Fallback::SETTING_ARRAY_COUNT_LIMIT)) {
// Budget array analysis.
$model->injectCallback(
$this->pool->cr... | php | public function process(Model $model)
{
$multiline = false;
$count = count($model->getData());
if ($count > (int) $this->pool->config->getSetting(Fallback::SETTING_ARRAY_COUNT_LIMIT)) {
// Budget array analysis.
$model->injectCallback(
$this->pool->cr... | [
"public",
"function",
"process",
"(",
"Model",
"$",
"model",
")",
"{",
"$",
"multiline",
"=",
"false",
";",
"$",
"count",
"=",
"count",
"(",
"$",
"model",
"->",
"getData",
"(",
")",
")",
";",
"if",
"(",
"$",
"count",
">",
"(",
"int",
")",
"$",
... | Render a dump for an array.
@param Model $model
The data we are analysing.
@return string
The rendered markup. | [
"Render",
"a",
"dump",
"for",
"an",
"array",
"."
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Analyse/Routing/Process/ProcessArray.php#L58-L82 |
33,757 | silverorange/swat | Swat/SwatXHTMLTextarea.php | SwatXHTMLTextarea.getValidationErrorMessage | protected function getValidationErrorMessage(array $xml_errors)
{
$ignored_errors = array(
'extra content at the end of the document',
'premature end of data in tag html',
'opening and ending tag mismatch between html and body',
'opening and ending tag mismatc... | php | protected function getValidationErrorMessage(array $xml_errors)
{
$ignored_errors = array(
'extra content at the end of the document',
'premature end of data in tag html',
'opening and ending tag mismatch between html and body',
'opening and ending tag mismatc... | [
"protected",
"function",
"getValidationErrorMessage",
"(",
"array",
"$",
"xml_errors",
")",
"{",
"$",
"ignored_errors",
"=",
"array",
"(",
"'extra content at the end of the document'",
",",
"'premature end of data in tag html'",
",",
"'opening and ending tag mismatch between html... | Gets a human readable error message for XHTML validation errors on
this textarea's value
@param array $xml_errors an array of LibXMLError objects.
@return SwatMessage a human readable error message for XHTML validation
errors on this textarea's value. | [
"Gets",
"a",
"human",
"readable",
"error",
"message",
"for",
"XHTML",
"validation",
"errors",
"on",
"this",
"textarea",
"s",
"value"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatXHTMLTextarea.php#L138-L209 |
33,758 | silverorange/swat | Swat/SwatXHTMLTextarea.php | SwatXHTMLTextarea.createCompositeWidgets | protected function createCompositeWidgets()
{
$this->ignore_errors_checkbox = new SwatCheckbox(
$this->id . '_ignore_checkbox'
);
$ignore_field = new SwatFormField($this->id . '_ignore_field');
$ignore_field->title = Swat::_('Ignore XHTML validation errors');
$ig... | php | protected function createCompositeWidgets()
{
$this->ignore_errors_checkbox = new SwatCheckbox(
$this->id . '_ignore_checkbox'
);
$ignore_field = new SwatFormField($this->id . '_ignore_field');
$ignore_field->title = Swat::_('Ignore XHTML validation errors');
$ig... | [
"protected",
"function",
"createCompositeWidgets",
"(",
")",
"{",
"$",
"this",
"->",
"ignore_errors_checkbox",
"=",
"new",
"SwatCheckbox",
"(",
"$",
"this",
"->",
"id",
".",
"'_ignore_checkbox'",
")",
";",
"$",
"ignore_field",
"=",
"new",
"SwatFormField",
"(",
... | Creates the composite checkbox used by this XHTML textarea
@see SwatWidget::createCompositeWidgets() | [
"Creates",
"the",
"composite",
"checkbox",
"used",
"by",
"this",
"XHTML",
"textarea"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatXHTMLTextarea.php#L219-L230 |
33,759 | silverorange/swat | Swat/SwatHtmlHeadEntrySetDisplayer.php | SwatHtmlHeadEntrySetDisplayer.display | public function display(
SwatHtmlHeadEntrySet $set,
$uri_prefix = '',
$tag = null,
$combine = false,
$minify = false
) {
// clone set so displaying doesn't modify it
$set = clone $set;
$entries = $set->toArray();
// combine files
if (... | php | public function display(
SwatHtmlHeadEntrySet $set,
$uri_prefix = '',
$tag = null,
$combine = false,
$minify = false
) {
// clone set so displaying doesn't modify it
$set = clone $set;
$entries = $set->toArray();
// combine files
if (... | [
"public",
"function",
"display",
"(",
"SwatHtmlHeadEntrySet",
"$",
"set",
",",
"$",
"uri_prefix",
"=",
"''",
",",
"$",
"tag",
"=",
"null",
",",
"$",
"combine",
"=",
"false",
",",
"$",
"minify",
"=",
"false",
")",
"{",
"// clone set so displaying doesn't modi... | Displays a set of HTML head entries
@param SwatHtmlHeadEntrySet $set the HTML head entry set to display.
@param string $uri_prefix an optional URI prefix to prepend to all the
displayed HTML head entries.
@param string $tag an optional tag to suffix the URI with. This is
suffixed as a HTTP get var and can be used to
e... | [
"Displays",
"a",
"set",
"of",
"HTML",
"head",
"entries"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatHtmlHeadEntrySetDisplayer.php#L52-L105 |
33,760 | silverorange/swat | Swat/SwatHtmlHeadEntrySetDisplayer.php | SwatHtmlHeadEntrySetDisplayer.displayInline | public function displayInline(
SwatHtmlHeadEntrySet $set,
$path,
$type = null
) {
$entries = $set->toArray();
$uris = array_keys($entries);
// check for conflicts in the displayed set
$this->checkForConflicts($uris);
// sort
$entries = $this... | php | public function displayInline(
SwatHtmlHeadEntrySet $set,
$path,
$type = null
) {
$entries = $set->toArray();
$uris = array_keys($entries);
// check for conflicts in the displayed set
$this->checkForConflicts($uris);
// sort
$entries = $this... | [
"public",
"function",
"displayInline",
"(",
"SwatHtmlHeadEntrySet",
"$",
"set",
",",
"$",
"path",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"entries",
"=",
"$",
"set",
"->",
"toArray",
"(",
")",
";",
"$",
"uris",
"=",
"array_keys",
"(",
"$",
"ent... | Displays the contents of the set of HTML head entries inline | [
"Displays",
"the",
"contents",
"of",
"the",
"set",
"of",
"HTML",
"head",
"entries",
"inline"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatHtmlHeadEntrySetDisplayer.php#L113-L139 |
33,761 | silverorange/swat | Swat/SwatHtmlHeadEntrySetDisplayer.php | SwatHtmlHeadEntrySetDisplayer.getCombinedEntries | protected function getCombinedEntries(array $entries)
{
$info = $this->concentrator->getCombines(array_keys($entries));
// add combines to set of entries
foreach ($info['combines'] as $combine) {
if (mb_substr($combine, -4) === '.css') {
$class_name = 'SwatStyleS... | php | protected function getCombinedEntries(array $entries)
{
$info = $this->concentrator->getCombines(array_keys($entries));
// add combines to set of entries
foreach ($info['combines'] as $combine) {
if (mb_substr($combine, -4) === '.css') {
$class_name = 'SwatStyleS... | [
"protected",
"function",
"getCombinedEntries",
"(",
"array",
"$",
"entries",
")",
"{",
"$",
"info",
"=",
"$",
"this",
"->",
"concentrator",
"->",
"getCombines",
"(",
"array_keys",
"(",
"$",
"entries",
")",
")",
";",
"// add combines to set of entries",
"foreach"... | Gets the entries of this set accounting for combining
@param array $entries
@return array the entries of this set accounting for combinations. | [
"Gets",
"the",
"entries",
"of",
"this",
"set",
"accounting",
"for",
"combining"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatHtmlHeadEntrySetDisplayer.php#L151-L174 |
33,762 | silverorange/swat | Swat/SwatHtmlHeadEntrySetDisplayer.php | SwatHtmlHeadEntrySetDisplayer.getSortedEntries | protected function getSortedEntries(array $original_entries)
{
$entries = array();
// get array of entries with native ordering so we can do a
// stable, user-defined sort
$count = 0;
foreach ($original_entries as $uri => $entry) {
$entries[] = array(
... | php | protected function getSortedEntries(array $original_entries)
{
$entries = array();
// get array of entries with native ordering so we can do a
// stable, user-defined sort
$count = 0;
foreach ($original_entries as $uri => $entry) {
$entries[] = array(
... | [
"protected",
"function",
"getSortedEntries",
"(",
"array",
"$",
"original_entries",
")",
"{",
"$",
"entries",
"=",
"array",
"(",
")",
";",
"// get array of entries with native ordering so we can do a",
"// stable, user-defined sort",
"$",
"count",
"=",
"0",
";",
"foreac... | Gets the entries of this set sorted by their correct display order
@param array $original_entries
@return array the entries of this set sorted by their correct display
order. | [
"Gets",
"the",
"entries",
"of",
"this",
"set",
"sorted",
"by",
"their",
"correct",
"display",
"order"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatHtmlHeadEntrySetDisplayer.php#L187-L213 |
33,763 | silverorange/swat | Swat/SwatHtmlHeadEntrySetDisplayer.php | SwatHtmlHeadEntrySetDisplayer.compareTypes | protected function compareTypes($a, $b)
{
// compare entry type order
$type_order = $this->getTypeOrder();
if (!array_key_exists($a, $type_order)) {
$a = '__unknown__';
}
if (!array_key_exists($b, $type_order)) {
$b = '__unknown__';
}
... | php | protected function compareTypes($a, $b)
{
// compare entry type order
$type_order = $this->getTypeOrder();
if (!array_key_exists($a, $type_order)) {
$a = '__unknown__';
}
if (!array_key_exists($b, $type_order)) {
$b = '__unknown__';
}
... | [
"protected",
"function",
"compareTypes",
"(",
"$",
"a",
",",
"$",
"b",
")",
"{",
"// compare entry type order",
"$",
"type_order",
"=",
"$",
"this",
"->",
"getTypeOrder",
"(",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"a",
",",
"$",
"type_o... | Compares two HTML head entry types
@param string $a left side of comparison.
@param string $b right side of comparison.
@return integer a tri-value where -1 means the left side is less than
the right side, 1 means the left side is greater than
the right side and 0 means the left side and right
side are equivalent. | [
"Compares",
"two",
"HTML",
"head",
"entry",
"types"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatHtmlHeadEntrySetDisplayer.php#L285-L307 |
33,764 | silverorange/swat | Swat/SwatHtmlHeadEntrySetDisplayer.php | SwatHtmlHeadEntrySetDisplayer.checkForConflicts | protected function checkForConflicts(array $uris)
{
$conflicts = $this->concentrator->getConflicts($uris);
if (count($conflicts) > 0) {
$conflict_list = '';
$count = 0;
foreach ($conflicts as $file => $conflict) {
$conflict_list .= sprintf(
... | php | protected function checkForConflicts(array $uris)
{
$conflicts = $this->concentrator->getConflicts($uris);
if (count($conflicts) > 0) {
$conflict_list = '';
$count = 0;
foreach ($conflicts as $file => $conflict) {
$conflict_list .= sprintf(
... | [
"protected",
"function",
"checkForConflicts",
"(",
"array",
"$",
"uris",
")",
"{",
"$",
"conflicts",
"=",
"$",
"this",
"->",
"concentrator",
"->",
"getConflicts",
"(",
"$",
"uris",
")",
";",
"if",
"(",
"count",
"(",
"$",
"conflicts",
")",
">",
"0",
")"... | Check for conflicts in a set of HTML head entry URIs
If a conflict is detected, an exception is thrown explaining the
conflict.
@param array $uris the HTML head entry URIs to check.
@throws SwatException if one or more conflicts are present. | [
"Check",
"for",
"conflicts",
"in",
"a",
"set",
"of",
"HTML",
"head",
"entry",
"URIs"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatHtmlHeadEntrySetDisplayer.php#L349-L370 |
33,765 | silverorange/swat | Swat/SwatCheckboxEntryList.php | SwatCheckboxEntryList.process | public function process()
{
if (
$this->getForm()->getHiddenField($this->id . '_submitted') === null
) {
return;
}
parent::process();
foreach ($this->values as $option_value) {
$this->getEntryWidget($option_value)->process();
}
... | php | public function process()
{
if (
$this->getForm()->getHiddenField($this->id . '_submitted') === null
) {
return;
}
parent::process();
foreach ($this->values as $option_value) {
$this->getEntryWidget($option_value)->process();
}
... | [
"public",
"function",
"process",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getForm",
"(",
")",
"->",
"getHiddenField",
"(",
"$",
"this",
"->",
"id",
".",
"'_submitted'",
")",
"===",
"null",
")",
"{",
"return",
";",
"}",
"parent",
"::",
"process",... | Processes this checkbox entry list
Processes the checkboxes as well as each entry widget for each checked
checkbox. The entry widgets for unchecked checkboxes are not processed.
@see SwatCheckboxList::process() | [
"Processes",
"this",
"checkbox",
"entry",
"list"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatCheckboxEntryList.php#L180-L193 |
33,766 | silverorange/swat | Swat/SwatCheckboxEntryList.php | SwatCheckboxEntryList.getEntryValue | public function getEntryValue($option_value)
{
$entry_value = null;
if ($this->hasEntryWidget($option_value)) {
$entry = $this->getEntryWidget($option_value)->getFirst();
$entry_value = $entry->value;
}
return $entry_value;
} | php | public function getEntryValue($option_value)
{
$entry_value = null;
if ($this->hasEntryWidget($option_value)) {
$entry = $this->getEntryWidget($option_value)->getFirst();
$entry_value = $entry->value;
}
return $entry_value;
} | [
"public",
"function",
"getEntryValue",
"(",
"$",
"option_value",
")",
"{",
"$",
"entry_value",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"hasEntryWidget",
"(",
"$",
"option_value",
")",
")",
"{",
"$",
"entry",
"=",
"$",
"this",
"->",
"getEntryWidge... | Gets the value of an entry widget in this checkbox entry list
@param string $option_value used to indentify the entry widget
@return string the value of the specified entry widget or null if no
such widget exists. | [
"Gets",
"the",
"value",
"of",
"an",
"entry",
"widget",
"in",
"this",
"checkbox",
"entry",
"list"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatCheckboxEntryList.php#L257-L267 |
33,767 | silverorange/swat | Swat/SwatCheckboxEntryList.php | SwatCheckboxEntryList.setEntryValue | public function setEntryValue($option_value, $entry_value)
{
$options = $this->getOptions();
$option_values = array();
foreach ($options as $option) {
$option_values[] = $option->value;
}
if (!in_array($option_value, $option_values)) {
throw new SwatI... | php | public function setEntryValue($option_value, $entry_value)
{
$options = $this->getOptions();
$option_values = array();
foreach ($options as $option) {
$option_values[] = $option->value;
}
if (!in_array($option_value, $option_values)) {
throw new SwatI... | [
"public",
"function",
"setEntryValue",
"(",
"$",
"option_value",
",",
"$",
"entry_value",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"getOptions",
"(",
")",
";",
"$",
"option_values",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"options",
... | Sets the value of an entry widget in this checkbox entry list
@param string $option_value the value of the option for which to set
the entry widget value.
@param string $entry_value the value to set on the entry widget.
@throws SwatInvalidPropertyException if the option value does not match
an existing option value i... | [
"Sets",
"the",
"value",
"of",
"an",
"entry",
"widget",
"in",
"this",
"checkbox",
"entry",
"list"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatCheckboxEntryList.php#L283-L302 |
33,768 | silverorange/swat | Swat/SwatCheckboxEntryList.php | SwatCheckboxEntryList.setEntryValuesByArray | public function setEntryValuesByArray(array $entry_values)
{
foreach ($entry_values as $option_value => $entry_value) {
$this->setEntryValue($option_value, $entry_value);
}
} | php | public function setEntryValuesByArray(array $entry_values)
{
foreach ($entry_values as $option_value => $entry_value) {
$this->setEntryValue($option_value, $entry_value);
}
} | [
"public",
"function",
"setEntryValuesByArray",
"(",
"array",
"$",
"entry_values",
")",
"{",
"foreach",
"(",
"$",
"entry_values",
"as",
"$",
"option_value",
"=>",
"$",
"entry_value",
")",
"{",
"$",
"this",
"->",
"setEntryValue",
"(",
"$",
"option_value",
",",
... | Sets the values of multiple entry widgets
This is a convenience method to quickly set the entry values for one
or more options in this checkbox entry list. This calls
{@link SwatCheckboxEntryList::setEntryValue()} internally for each
entry in the <i>$entry_values</i> array.
@param array $entry_values an array indexed... | [
"Sets",
"the",
"values",
"of",
"multiple",
"entry",
"widgets"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatCheckboxEntryList.php#L323-L328 |
33,769 | silverorange/swat | Swat/SwatCheckboxEntryList.php | SwatCheckboxEntryList.getInlineJavaScript | protected function getInlineJavaScript()
{
$javascript = sprintf(
"var %s_obj = new SwatCheckboxEntryList('%s');",
$this->id,
$this->id
);
// set check-all controller if it is visible
if ($this->show_check_all && count($this->getOptions()) > 1) {
... | php | protected function getInlineJavaScript()
{
$javascript = sprintf(
"var %s_obj = new SwatCheckboxEntryList('%s');",
$this->id,
$this->id
);
// set check-all controller if it is visible
if ($this->show_check_all && count($this->getOptions()) > 1) {
... | [
"protected",
"function",
"getInlineJavaScript",
"(",
")",
"{",
"$",
"javascript",
"=",
"sprintf",
"(",
"\"var %s_obj = new SwatCheckboxEntryList('%s');\"",
",",
"$",
"this",
"->",
"id",
",",
"$",
"this",
"->",
"id",
")",
";",
"// set check-all controller if it is visi... | Gets the inline JavaScript for this checkbox entry list
@return string the inline JavaScript for this checkbox entry list. | [
"Gets",
"the",
"inline",
"JavaScript",
"for",
"this",
"checkbox",
"entry",
"list"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatCheckboxEntryList.php#L338-L356 |
33,770 | silverorange/swat | Swat/SwatCheckboxEntryList.php | SwatCheckboxEntryList.getEntryWidget | protected function getEntryWidget($option_value)
{
if (!$this->hasEntryWidget($option_value)) {
$container = new SwatFormField(
$this->id . '_field_' . $option_value
);
$container->add($this->createEntryWidget($option_value));
$container->paren... | php | protected function getEntryWidget($option_value)
{
if (!$this->hasEntryWidget($option_value)) {
$container = new SwatFormField(
$this->id . '_field_' . $option_value
);
$container->add($this->createEntryWidget($option_value));
$container->paren... | [
"protected",
"function",
"getEntryWidget",
"(",
"$",
"option_value",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasEntryWidget",
"(",
"$",
"option_value",
")",
")",
"{",
"$",
"container",
"=",
"new",
"SwatFormField",
"(",
"$",
"this",
"->",
"id",
".",... | Gets a widget tree for the entry widget of this checkbox entry list
This is used internally to create the widget tree containing a
{@link SwatEntry} widget for display and processing.
@param string $option_value the value of the option for which to get
the entry widget. If no entry widget exists
for the given option ... | [
"Gets",
"a",
"widget",
"tree",
"for",
"the",
"entry",
"widget",
"of",
"this",
"checkbox",
"entry",
"list"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatCheckboxEntryList.php#L408-L421 |
33,771 | silverorange/swat | Swat/SwatCheckboxEntryList.php | SwatCheckboxEntryList.createEntryWidget | protected function createEntryWidget($option_value)
{
$widget = new SwatEntry($this->id . '_entry_' . $option_value);
$widget->size = $this->entry_size;
$widget->maxlength = $this->entry_maxlength;
return $widget;
} | php | protected function createEntryWidget($option_value)
{
$widget = new SwatEntry($this->id . '_entry_' . $option_value);
$widget->size = $this->entry_size;
$widget->maxlength = $this->entry_maxlength;
return $widget;
} | [
"protected",
"function",
"createEntryWidget",
"(",
"$",
"option_value",
")",
"{",
"$",
"widget",
"=",
"new",
"SwatEntry",
"(",
"$",
"this",
"->",
"id",
".",
"'_entry_'",
".",
"$",
"option_value",
")",
";",
"$",
"widget",
"->",
"size",
"=",
"$",
"this",
... | Creates an entry widget of this checkbox entry list
Subclasses may override this method to create a different widget type.
@param string $option_value the value of the option for which to get
the entry widget.
@return SwatEntry the new entry widget for the given option value. | [
"Creates",
"an",
"entry",
"widget",
"of",
"this",
"checkbox",
"entry",
"list"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatCheckboxEntryList.php#L436-L442 |
33,772 | silverorange/swat | Swat/SwatReplicableFormField.php | SwatReplicableFormField.init | public function init()
{
$children = array();
foreach ($this->children as $child_widget) {
$children[] = $this->remove($child_widget);
}
$field = new SwatFormField();
$field->id = $field->getUniqueId();
$prototype_id = $field->id;
foreach ($child... | php | public function init()
{
$children = array();
foreach ($this->children as $child_widget) {
$children[] = $this->remove($child_widget);
}
$field = new SwatFormField();
$field->id = $field->getUniqueId();
$prototype_id = $field->id;
foreach ($child... | [
"public",
"function",
"init",
"(",
")",
"{",
"$",
"children",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"children",
"as",
"$",
"child_widget",
")",
"{",
"$",
"children",
"[",
"]",
"=",
"$",
"this",
"->",
"remove",
"(",
"$",
... | Initilizes this replicable form field | [
"Initilizes",
"this",
"replicable",
"form",
"field"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatReplicableFormField.php#L23-L46 |
33,773 | honey-comb/core | src/Http/Controllers/HCAuthController.php | HCAuthController.deAuthorize | private function deAuthorize(User $user): void
{
$client = new Client;
$client->delete("https://graph.facebook.com/{$user->id}/permissions",
[
'headers' => ['Accept' => 'application/json'],
'form_params' => [
'access_token' => $user->t... | php | private function deAuthorize(User $user): void
{
$client = new Client;
$client->delete("https://graph.facebook.com/{$user->id}/permissions",
[
'headers' => ['Accept' => 'application/json'],
'form_params' => [
'access_token' => $user->t... | [
"private",
"function",
"deAuthorize",
"(",
"User",
"$",
"user",
")",
":",
"void",
"{",
"$",
"client",
"=",
"new",
"Client",
";",
"$",
"client",
"->",
"delete",
"(",
"\"https://graph.facebook.com/{$user->id}/permissions\"",
",",
"[",
"'headers'",
"=>",
"[",
"'A... | DeAuthorize user from app
@param User $user
@return void | [
"DeAuthorize",
"user",
"from",
"app"
] | 5c12aba31cae092e9681f0ae3e3664ed3fcec956 | https://github.com/honey-comb/core/blob/5c12aba31cae092e9681f0ae3e3664ed3fcec956/src/Http/Controllers/HCAuthController.php#L317-L329 |
33,774 | mindkomm/types | lib/Post_Type_Page.php | Post_Type_Page.update_archive_slug | public function update_archive_slug( $args, $post_type ) {
if ( $post_type !== $this->post_type ) {
return $args;
}
$args['has_archive'] = trim(
wp_make_link_relative( get_permalink( $this->post_id ) ),
'/'
);
return $args;
} | php | public function update_archive_slug( $args, $post_type ) {
if ( $post_type !== $this->post_type ) {
return $args;
}
$args['has_archive'] = trim(
wp_make_link_relative( get_permalink( $this->post_id ) ),
'/'
);
return $args;
} | [
"public",
"function",
"update_archive_slug",
"(",
"$",
"args",
",",
"$",
"post_type",
")",
"{",
"if",
"(",
"$",
"post_type",
"!==",
"$",
"this",
"->",
"post_type",
")",
"{",
"return",
"$",
"args",
";",
"}",
"$",
"args",
"[",
"'has_archive'",
"]",
"=",
... | Update the archive slug to be the same as the page that should be used for the archive.
@param array $args Post type registration arguments.
@param string $post_type Post type name.
@return mixed | [
"Update",
"the",
"archive",
"slug",
"to",
"be",
"the",
"same",
"as",
"the",
"page",
"that",
"should",
"be",
"used",
"for",
"the",
"archive",
"."
] | a075d59acf995605427ce8a647a10ed12463b856 | https://github.com/mindkomm/types/blob/a075d59acf995605427ce8a647a10ed12463b856/lib/Post_Type_Page.php#L72-L83 |
33,775 | mindkomm/types | lib/Post_Type_Page.php | Post_Type_Page.filter_wp_nav_menu_objects | public function filter_wp_nav_menu_objects( $menu_items ) {
foreach ( $menu_items as &$item ) {
if ( 'page' !== $item->object || (int) $item->object_id !== $this->post_id ) {
continue;
}
if ( is_singular( $this->post_type ) ) {
$item->current_item_parent = true;
$item->classes[] = 'cur... | php | public function filter_wp_nav_menu_objects( $menu_items ) {
foreach ( $menu_items as &$item ) {
if ( 'page' !== $item->object || (int) $item->object_id !== $this->post_id ) {
continue;
}
if ( is_singular( $this->post_type ) ) {
$item->current_item_parent = true;
$item->classes[] = 'cur... | [
"public",
"function",
"filter_wp_nav_menu_objects",
"(",
"$",
"menu_items",
")",
"{",
"foreach",
"(",
"$",
"menu_items",
"as",
"&",
"$",
"item",
")",
"{",
"if",
"(",
"'page'",
"!==",
"$",
"item",
"->",
"object",
"||",
"(",
"int",
")",
"$",
"item",
"->"... | Make sure menu items for our pages get the correct classes assigned
@param array $menu_items Array of menu items.
@return array | [
"Make",
"sure",
"menu",
"items",
"for",
"our",
"pages",
"get",
"the",
"correct",
"classes",
"assigned"
] | a075d59acf995605427ce8a647a10ed12463b856 | https://github.com/mindkomm/types/blob/a075d59acf995605427ce8a647a10ed12463b856/lib/Post_Type_Page.php#L102-L124 |
33,776 | silverorange/swat | Swat/SwatPercentageEntry.php | SwatPercentageEntry.getDisplayValue | protected function getDisplayValue($value)
{
if (is_numeric($value)) {
$value = $value * 100;
$value = parent::getDisplayValue($value);
$value = $value . '%';
} else {
$value = parent::getDisplayValue($value);
}
return $value;
} | php | protected function getDisplayValue($value)
{
if (is_numeric($value)) {
$value = $value * 100;
$value = parent::getDisplayValue($value);
$value = $value . '%';
} else {
$value = parent::getDisplayValue($value);
}
return $value;
} | [
"protected",
"function",
"getDisplayValue",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"$",
"value",
"*",
"100",
";",
"$",
"value",
"=",
"parent",
"::",
"getDisplayValue",
"(",
"$",
"val... | Returns a value for this widget
The method returns a value to be displayed in the widget
@return string the final percentage value | [
"Returns",
"a",
"value",
"for",
"this",
"widget"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatPercentageEntry.php#L21-L32 |
33,777 | silverorange/swat | Swat/SwatPercentageEntry.php | SwatPercentageEntry.getNumericValue | protected function getNumericValue($value)
{
$value = trim($value);
$value = str_replace('%', '', $value);
$value = parent::getNumericValue($value);
if ($value !== null) {
$value = $value / 100;
}
return $value;
} | php | protected function getNumericValue($value)
{
$value = trim($value);
$value = str_replace('%', '', $value);
$value = parent::getNumericValue($value);
if ($value !== null) {
$value = $value / 100;
}
return $value;
} | [
"protected",
"function",
"getNumericValue",
"(",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"trim",
"(",
"$",
"value",
")",
";",
"$",
"value",
"=",
"str_replace",
"(",
"'%'",
",",
"''",
",",
"$",
"value",
")",
";",
"$",
"value",
"=",
"parent",
"::"... | Gets the float value of this widget
This allows each widget to parse raw values and turn them into floats
@param string $value the raw value to use to get the numeric value.
@return mixed the numeric value of this entry widget or null if no
no numeric value is available. | [
"Gets",
"the",
"float",
"value",
"of",
"this",
"widget"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatPercentageEntry.php#L47-L57 |
33,778 | silverorange/swat | Swat/SwatIntegerEntry.php | SwatIntegerEntry.process | public function process()
{
parent::process();
if ($this->value === null) {
return;
}
try {
$integer_value = $this->getNumericValue($this->value);
if ($integer_value === null) {
$this->addMessage($this->getValidationMessage('inte... | php | public function process()
{
parent::process();
if ($this->value === null) {
return;
}
try {
$integer_value = $this->getNumericValue($this->value);
if ($integer_value === null) {
$this->addMessage($this->getValidationMessage('inte... | [
"public",
"function",
"process",
"(",
")",
"{",
"parent",
"::",
"process",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"value",
"===",
"null",
")",
"{",
"return",
";",
"}",
"try",
"{",
"$",
"integer_value",
"=",
"$",
"this",
"->",
"getNumericValue",... | Checks to make sure value is an integer
If the value of this widget is not an integer then an error message is
attached to this widget. | [
"Checks",
"to",
"make",
"sure",
"value",
"is",
"an",
"integer"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatIntegerEntry.php#L20-L49 |
33,779 | silverorange/swat | Swat/SwatIntegerEntry.php | SwatIntegerEntry.getValidationMessage | protected function getValidationMessage($id)
{
switch ($id) {
case 'integer':
if ($this->minimum_value < 0) {
$text = $this->show_field_title_in_messages
? Swat::_('The %s field must be an integer.')
: Swat::_('T... | php | protected function getValidationMessage($id)
{
switch ($id) {
case 'integer':
if ($this->minimum_value < 0) {
$text = $this->show_field_title_in_messages
? Swat::_('The %s field must be an integer.')
: Swat::_('T... | [
"protected",
"function",
"getValidationMessage",
"(",
"$",
"id",
")",
"{",
"switch",
"(",
"$",
"id",
")",
"{",
"case",
"'integer'",
":",
"if",
"(",
"$",
"this",
"->",
"minimum_value",
"<",
"0",
")",
"{",
"$",
"text",
"=",
"$",
"this",
"->",
"show_fie... | Gets a validation message for this integer entry
@see SwatEntry::getValidationMessage()
@param string $id the string identifier of the validation message.
@return SwatMessage the validation message. | [
"Gets",
"a",
"validation",
"message",
"for",
"this",
"integer",
"entry"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatIntegerEntry.php#L108-L146 |
33,780 | silverorange/swat | Swat/SwatFlydown.php | SwatFlydown.process | public function process()
{
parent::process();
if (!$this->processValue()) {
return;
}
if ($this->required && $this->isSensitive()) {
// When values are not serialized, an empty string is treated as
// null. As a result, you should not use a null... | php | public function process()
{
parent::process();
if (!$this->processValue()) {
return;
}
if ($this->required && $this->isSensitive()) {
// When values are not serialized, an empty string is treated as
// null. As a result, you should not use a null... | [
"public",
"function",
"process",
"(",
")",
"{",
"parent",
"::",
"process",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"processValue",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"required",
"&&",
"$",
"this",
"->"... | Figures out what option was selected
Processes this widget and figures out what select element from this
flydown was selected. Any validation errors cause an error message to
be attached to this widget in this method. | [
"Figures",
"out",
"what",
"option",
"was",
"selected"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatFlydown.php#L171-L191 |
33,781 | silverorange/swat | Swat/SwatFlydown.php | SwatFlydown.processValue | protected function processValue()
{
$form = $this->getForm();
$data = &$form->getFormData();
if (!isset($data[$this->id])) {
return false;
}
if ($this->serialize_values) {
$salt = $form->getSalt();
$this->value = SwatString::signedUnseria... | php | protected function processValue()
{
$form = $this->getForm();
$data = &$form->getFormData();
if (!isset($data[$this->id])) {
return false;
}
if ($this->serialize_values) {
$salt = $form->getSalt();
$this->value = SwatString::signedUnseria... | [
"protected",
"function",
"processValue",
"(",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"getForm",
"(",
")",
";",
"$",
"data",
"=",
"&",
"$",
"form",
"->",
"getFormData",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"data",
"[",
"$",
... | Processes the value of this flydown from user-submitted form data
@return boolean true if the value was processed from form data | [
"Processes",
"the",
"value",
"of",
"this",
"flydown",
"from",
"user",
"-",
"submitted",
"form",
"data"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatFlydown.php#L295-L315 |
33,782 | silverorange/swat | Swat/SwatFlydown.php | SwatFlydown.displaySingle | protected function displaySingle(SwatOption $flydown_option)
{
$title = $flydown_option->title;
$value = $flydown_option->value;
$hidden_tag = new SwatHtmlTag('input');
$hidden_tag->type = 'hidden';
$hidden_tag->name = $this->id;
if ($this->serialize_values) {
... | php | protected function displaySingle(SwatOption $flydown_option)
{
$title = $flydown_option->title;
$value = $flydown_option->value;
$hidden_tag = new SwatHtmlTag('input');
$hidden_tag->type = 'hidden';
$hidden_tag->name = $this->id;
if ($this->serialize_values) {
... | [
"protected",
"function",
"displaySingle",
"(",
"SwatOption",
"$",
"flydown_option",
")",
"{",
"$",
"title",
"=",
"$",
"flydown_option",
"->",
"title",
";",
"$",
"value",
"=",
"$",
"flydown_option",
"->",
"value",
";",
"$",
"hidden_tag",
"=",
"new",
"SwatHtml... | Displays this flydown if there is only a single option | [
"Displays",
"this",
"flydown",
"if",
"there",
"is",
"only",
"a",
"single",
"option"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatFlydown.php#L323-L345 |
33,783 | FreeDSx/Socket | src/FreeDSx/Socket/SocketServer.php | SocketServer.listen | public function listen(string $ip, int $port)
{
$flags = STREAM_SERVER_BIND;
if ($this->options['transport'] !== 'udp') {
$flags |= STREAM_SERVER_LISTEN;
}
$this->socket = @\stream_socket_server(
$this->options['transport'].'://'.$ip.':'.$port,
$th... | php | public function listen(string $ip, int $port)
{
$flags = STREAM_SERVER_BIND;
if ($this->options['transport'] !== 'udp') {
$flags |= STREAM_SERVER_LISTEN;
}
$this->socket = @\stream_socket_server(
$this->options['transport'].'://'.$ip.':'.$port,
$th... | [
"public",
"function",
"listen",
"(",
"string",
"$",
"ip",
",",
"int",
"$",
"port",
")",
"{",
"$",
"flags",
"=",
"STREAM_SERVER_BIND",
";",
"if",
"(",
"$",
"this",
"->",
"options",
"[",
"'transport'",
"]",
"!==",
"'udp'",
")",
"{",
"$",
"flags",
"|=",... | Create the socket server and bind to a specific port to listen for clients.
@param string $ip
@param int $port
@return $this
@throws ConnectionException
@internal param string $ip | [
"Create",
"the",
"socket",
"server",
"and",
"bind",
"to",
"a",
"specific",
"port",
"to",
"listen",
"for",
"clients",
"."
] | d74683bf8b827e91a8ca051805c55dacaf64f93d | https://github.com/FreeDSx/Socket/blob/d74683bf8b827e91a8ca051805c55dacaf64f93d/src/FreeDSx/Socket/SocketServer.php#L56-L79 |
33,784 | FreeDSx/Socket | src/FreeDSx/Socket/SocketServer.php | SocketServer.receive | public function receive(&$ipAddress = null)
{
$this->block(true);
return \stream_socket_recvfrom($this->socket, 65507, 0, $ipAddress);
} | php | public function receive(&$ipAddress = null)
{
$this->block(true);
return \stream_socket_recvfrom($this->socket, 65507, 0, $ipAddress);
} | [
"public",
"function",
"receive",
"(",
"&",
"$",
"ipAddress",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"block",
"(",
"true",
")",
";",
"return",
"\\",
"stream_socket_recvfrom",
"(",
"$",
"this",
"->",
"socket",
",",
"65507",
",",
"0",
",",
"$",
"ipAd... | Receive data from a UDP based socket. Optionally get the IP address the data was received from.
@todo Buffer size should be adjustable. Max UDP packet size is 65507. Currently this avoids possible truncation.
@param null $ipAddress
@return null|string | [
"Receive",
"data",
"from",
"a",
"UDP",
"based",
"socket",
".",
"Optionally",
"get",
"the",
"IP",
"address",
"the",
"data",
"was",
"received",
"from",
"."
] | d74683bf8b827e91a8ca051805c55dacaf64f93d | https://github.com/FreeDSx/Socket/blob/d74683bf8b827e91a8ca051805c55dacaf64f93d/src/FreeDSx/Socket/SocketServer.php#L105-L110 |
33,785 | FreeDSx/Socket | src/FreeDSx/Socket/SocketServer.php | SocketServer.bind | public static function bind(string $ip, int $port, array $options = []) : SocketServer
{
return (new self($options))->listen($ip, $port);
} | php | public static function bind(string $ip, int $port, array $options = []) : SocketServer
{
return (new self($options))->listen($ip, $port);
} | [
"public",
"static",
"function",
"bind",
"(",
"string",
"$",
"ip",
",",
"int",
"$",
"port",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"SocketServer",
"{",
"return",
"(",
"new",
"self",
"(",
"$",
"options",
")",
")",
"->",
"listen",
"(",... | Create the socket server. Binds and listens on a specific port
@param string $ip
@param int $port
@param array $options
@return $this
@throws ConnectionException | [
"Create",
"the",
"socket",
"server",
".",
"Binds",
"and",
"listens",
"on",
"a",
"specific",
"port"
] | d74683bf8b827e91a8ca051805c55dacaf64f93d | https://github.com/FreeDSx/Socket/blob/d74683bf8b827e91a8ca051805c55dacaf64f93d/src/FreeDSx/Socket/SocketServer.php#L139-L142 |
33,786 | FreeDSx/Socket | src/FreeDSx/Socket/SocketServer.php | SocketServer.bindTcp | public static function bindTcp(string $ip, int $port, array $options = []) : SocketServer
{
return static::bind($ip, $port, \array_merge($options, ['transport' => 'tcp']));
} | php | public static function bindTcp(string $ip, int $port, array $options = []) : SocketServer
{
return static::bind($ip, $port, \array_merge($options, ['transport' => 'tcp']));
} | [
"public",
"static",
"function",
"bindTcp",
"(",
"string",
"$",
"ip",
",",
"int",
"$",
"port",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"SocketServer",
"{",
"return",
"static",
"::",
"bind",
"(",
"$",
"ip",
",",
"$",
"port",
",",
"\\",... | Create a TCP based socket server.
@param string $ip
@param int $port
@param array $options
@return SocketServer
@throws ConnectionException | [
"Create",
"a",
"TCP",
"based",
"socket",
"server",
"."
] | d74683bf8b827e91a8ca051805c55dacaf64f93d | https://github.com/FreeDSx/Socket/blob/d74683bf8b827e91a8ca051805c55dacaf64f93d/src/FreeDSx/Socket/SocketServer.php#L153-L156 |
33,787 | brainworxx/kreXX | src/Analyse/Routing/Process/ProcessResource.php | ProcessResource.process | public function process(Model $model)
{
$resource = $model->getData();
$type = get_resource_type($resource);
$typeString = 'resource (' . $type . ')';
switch ($type) {
case 'stream':
$meta = stream_get_meta_data($resource);
break;
... | php | public function process(Model $model)
{
$resource = $model->getData();
$type = get_resource_type($resource);
$typeString = 'resource (' . $type . ')';
switch ($type) {
case 'stream':
$meta = stream_get_meta_data($resource);
break;
... | [
"public",
"function",
"process",
"(",
"Model",
"$",
"model",
")",
"{",
"$",
"resource",
"=",
"$",
"model",
"->",
"getData",
"(",
")",
";",
"$",
"type",
"=",
"get_resource_type",
"(",
"$",
"resource",
")",
";",
"$",
"typeString",
"=",
"'resource ('",
".... | Analyses a resource.
@param Model $model
The data we are analysing.
@return string
The rendered markup. | [
"Analyses",
"a",
"resource",
"."
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Analyse/Routing/Process/ProcessResource.php#L57-L101 |
33,788 | honey-comb/core | src/Console/HCCreateSuperAdminCommand.php | HCCreateSuperAdminCommand.getEmail | private function getEmail(): ? string
{
$email = $this->ask("Enter email address");
$validator = Validator::make(['email' => $email], [
'email' => 'required|min:3|email',
]);
if ($validator->fails()) {
$this->error('Email is required, minimum 3 symbols lengt... | php | private function getEmail(): ? string
{
$email = $this->ask("Enter email address");
$validator = Validator::make(['email' => $email], [
'email' => 'required|min:3|email',
]);
if ($validator->fails()) {
$this->error('Email is required, minimum 3 symbols lengt... | [
"private",
"function",
"getEmail",
"(",
")",
":",
"?",
"string",
"{",
"$",
"email",
"=",
"$",
"this",
"->",
"ask",
"(",
"\"Enter email address\"",
")",
";",
"$",
"validator",
"=",
"Validator",
"::",
"make",
"(",
"[",
"'email'",
"=>",
"$",
"email",
"]",... | Get email address
@return null|string | [
"Get",
"email",
"address"
] | 5c12aba31cae092e9681f0ae3e3664ed3fcec956 | https://github.com/honey-comb/core/blob/5c12aba31cae092e9681f0ae3e3664ed3fcec956/src/Console/HCCreateSuperAdminCommand.php#L122-L139 |
33,789 | honey-comb/core | src/Console/HCCreateSuperAdminCommand.php | HCCreateSuperAdminCommand.createSuperAdmin | private function createSuperAdmin(): void
{
$this->getEmail();
$this->info('');
$this->comment('Creating default super-admin user...');
$this->info('');
$this->checkIfAdminExists();
$this->getPassword();
$this->createAdmin();
$this->comment('Super... | php | private function createSuperAdmin(): void
{
$this->getEmail();
$this->info('');
$this->comment('Creating default super-admin user...');
$this->info('');
$this->checkIfAdminExists();
$this->getPassword();
$this->createAdmin();
$this->comment('Super... | [
"private",
"function",
"createSuperAdmin",
"(",
")",
":",
"void",
"{",
"$",
"this",
"->",
"getEmail",
"(",
")",
";",
"$",
"this",
"->",
"info",
"(",
"''",
")",
";",
"$",
"this",
"->",
"comment",
"(",
"'Creating default super-admin user...'",
")",
";",
"$... | Create super admin account | [
"Create",
"super",
"admin",
"account"
] | 5c12aba31cae092e9681f0ae3e3664ed3fcec956 | https://github.com/honey-comb/core/blob/5c12aba31cae092e9681f0ae3e3664ed3fcec956/src/Console/HCCreateSuperAdminCommand.php#L144-L163 |
33,790 | honey-comb/core | src/Console/HCScanRolePermissionsCommand.php | HCScanRolePermissionsCommand.extractAllActions | private function extractAllActions(array $aclData): array
{
$allRolesActions = [];
// get all role actions available
foreach ($aclData as $acl) {
if (isset($acl['acl']['rolesActions']) && !empty ($acl['acl']['rolesActions'])) {
foreach ($acl['acl']['rolesActions'... | php | private function extractAllActions(array $aclData): array
{
$allRolesActions = [];
// get all role actions available
foreach ($aclData as $acl) {
if (isset($acl['acl']['rolesActions']) && !empty ($acl['acl']['rolesActions'])) {
foreach ($acl['acl']['rolesActions'... | [
"private",
"function",
"extractAllActions",
"(",
"array",
"$",
"aclData",
")",
":",
"array",
"{",
"$",
"allRolesActions",
"=",
"[",
"]",
";",
"// get all role actions available",
"foreach",
"(",
"$",
"aclData",
"as",
"$",
"acl",
")",
"{",
"if",
"(",
"isset",... | Extract all actions from roles config
@param array $aclData
@return array | [
"Extract",
"all",
"actions",
"from",
"roles",
"config"
] | 5c12aba31cae092e9681f0ae3e3664ed3fcec956 | https://github.com/honey-comb/core/blob/5c12aba31cae092e9681f0ae3e3664ed3fcec956/src/Console/HCScanRolePermissionsCommand.php#L309-L327 |
33,791 | rhoone/yii2-rhoone | models/SynonymQuery.php | SynonymQuery.headword | public function headword($headword)
{
if ($headword instanceof Headword) {
return $this->andWhere(['headword_guid' => $headword->guid]);
}
if (is_string($headword)) {
$headword = Headword::find()->where(['word' => $headword])->one();
if (!$headword) {
... | php | public function headword($headword)
{
if ($headword instanceof Headword) {
return $this->andWhere(['headword_guid' => $headword->guid]);
}
if (is_string($headword)) {
$headword = Headword::find()->where(['word' => $headword])->one();
if (!$headword) {
... | [
"public",
"function",
"headword",
"(",
"$",
"headword",
")",
"{",
"if",
"(",
"$",
"headword",
"instanceof",
"Headword",
")",
"{",
"return",
"$",
"this",
"->",
"andWhere",
"(",
"[",
"'headword_guid'",
"=>",
"$",
"headword",
"->",
"guid",
"]",
")",
";",
... | Attach headword.
@param string|Headword $headword
@return \static | [
"Attach",
"headword",
"."
] | f6ae90d466ea6f34bba404be0aba03e37ef369ad | https://github.com/rhoone/yii2-rhoone/blob/f6ae90d466ea6f34bba404be0aba03e37ef369ad/models/SynonymQuery.php#L55-L67 |
33,792 | rollun-com/rollun-datastore | src/DataStore/src/DataStore/Traits/AutoIdGeneratorTrait.php | AutoIdGeneratorTrait.generateId | protected function generateId()
{
trigger_error(AutoIdGeneratorTrait::class . ' trait is deprecated', E_USER_DEPRECATED);
$tryCount = 0;
do {
$id = $this->idGenerator->generate();
$tryCount++;
if ($tryCount >= $this->getIdGenerateMaxTry()) {
... | php | protected function generateId()
{
trigger_error(AutoIdGeneratorTrait::class . ' trait is deprecated', E_USER_DEPRECATED);
$tryCount = 0;
do {
$id = $this->idGenerator->generate();
$tryCount++;
if ($tryCount >= $this->getIdGenerateMaxTry()) {
... | [
"protected",
"function",
"generateId",
"(",
")",
"{",
"trigger_error",
"(",
"AutoIdGeneratorTrait",
"::",
"class",
".",
"' trait is deprecated'",
",",
"E_USER_DEPRECATED",
")",
";",
"$",
"tryCount",
"=",
"0",
";",
"do",
"{",
"$",
"id",
"=",
"$",
"this",
"->"... | Generates an arbitrary length string of cryptographic random bytes
@return string
@throws DataStoreException | [
"Generates",
"an",
"arbitrary",
"length",
"string",
"of",
"cryptographic",
"random",
"bytes"
] | ef433b58b94e1c311123ad1b2a0360e95a636bd1 | https://github.com/rollun-com/rollun-datastore/blob/ef433b58b94e1c311123ad1b2a0360e95a636bd1/src/DataStore/src/DataStore/Traits/AutoIdGeneratorTrait.php#L29-L45 |
33,793 | rollun-com/rollun-datastore | src/DataStore/src/DataStore/Traits/AutoIdGeneratorTrait.php | AutoIdGeneratorTrait.prepareItem | protected function prepareItem(array $itemData)
{
if (!isset($itemData[$this->getIdentifier()])) {
$itemData[$this->getIdentifier()] = $this->generateId();
}
return $itemData;
} | php | protected function prepareItem(array $itemData)
{
if (!isset($itemData[$this->getIdentifier()])) {
$itemData[$this->getIdentifier()] = $this->generateId();
}
return $itemData;
} | [
"protected",
"function",
"prepareItem",
"(",
"array",
"$",
"itemData",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"itemData",
"[",
"$",
"this",
"->",
"getIdentifier",
"(",
")",
"]",
")",
")",
"{",
"$",
"itemData",
"[",
"$",
"this",
"->",
"getIdenti... | Generate id to item
@param array $itemData
@return array
@throws DataStoreException | [
"Generate",
"id",
"to",
"item"
] | ef433b58b94e1c311123ad1b2a0360e95a636bd1 | https://github.com/rollun-com/rollun-datastore/blob/ef433b58b94e1c311123ad1b2a0360e95a636bd1/src/DataStore/src/DataStore/Traits/AutoIdGeneratorTrait.php#L81-L88 |
33,794 | brainworxx/kreXX | src/Service/Misc/Registry.php | Registry.get | public function get($key)
{
if (empty($this->data[$key]) === true) {
return null;
}
return $this->data[$key];
} | php | public function get($key)
{
if (empty($this->data[$key]) === true) {
return null;
}
return $this->data[$key];
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"data",
"[",
"$",
"key",
"]",
")",
"===",
"true",
")",
"{",
"return",
"null",
";",
"}",
"return",
"$",
"this",
"->",
"data",
"[",
"$",
"key",
... | Getter for the registry.
@param $key
The key under what we once stored the $value,
@return null|mixed
The value, if available. | [
"Getter",
"for",
"the",
"registry",
"."
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Service/Misc/Registry.php#L81-L88 |
33,795 | silverorange/swat | Swat/SwatConfirmPasswordEntry.php | SwatConfirmPasswordEntry.process | public function process()
{
parent::process();
if ($this->password_widget === null) {
throw new SwatException(
"Property 'password_widget' is null. " .
'Expected a reference to a SwatPasswordEntry.'
);
}
if ($this->passwor... | php | public function process()
{
parent::process();
if ($this->password_widget === null) {
throw new SwatException(
"Property 'password_widget' is null. " .
'Expected a reference to a SwatPasswordEntry.'
);
}
if ($this->passwor... | [
"public",
"function",
"process",
"(",
")",
"{",
"parent",
"::",
"process",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"password_widget",
"===",
"null",
")",
"{",
"throw",
"new",
"SwatException",
"(",
"\"Property 'password_widget' is null. \"",
".",
"'Expecte... | Checks to make sure passwords match
Checks to make sure the values of the two password fields are the same.
If an associated password widget is not set, an exception is thrown. If
the passwords do not match, an error is added to this widget.
@throws SwatException | [
"Checks",
"to",
"make",
"sure",
"passwords",
"match"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatConfirmPasswordEntry.php#L36-L56 |
33,796 | brainworxx/kreXX | src/Analyse/Callback/Analyse/ConfigSection.php | ConfigSection.callMe | public function callMe()
{
$sectionOutput = $this->dispatchStartEvent();
foreach ($this->parameters[static::PARAM_DATA] as $id => $setting) {
// Render the single value.
// We need to find out where the value comes from.
/** @var \Brainworxx\Krexx\Service\Config\... | php | public function callMe()
{
$sectionOutput = $this->dispatchStartEvent();
foreach ($this->parameters[static::PARAM_DATA] as $id => $setting) {
// Render the single value.
// We need to find out where the value comes from.
/** @var \Brainworxx\Krexx\Service\Config\... | [
"public",
"function",
"callMe",
"(",
")",
"{",
"$",
"sectionOutput",
"=",
"$",
"this",
"->",
"dispatchStartEvent",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"parameters",
"[",
"static",
"::",
"PARAM_DATA",
"]",
"as",
"$",
"id",
"=>",
"$",
"sett... | Renders each section of the footer.
@return string
The generated markup. | [
"Renders",
"each",
"section",
"of",
"the",
"footer",
"."
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Analyse/Callback/Analyse/ConfigSection.php#L63-L104 |
33,797 | rhoone/yii2-rhoone | controllers/ExtensionController.php | ExtensionController.actionIndex | public function actionIndex()
{
$extensions = Extension::find()->all();
if (empty($extensions)) {
echo "<empty list>";
}
echo"|";
echo sprintf("%28s", "Class Name");
echo"|";
echo sprintf("%4s", "Enb");
echo"|";
echo sprintf("%4s", ... | php | public function actionIndex()
{
$extensions = Extension::find()->all();
if (empty($extensions)) {
echo "<empty list>";
}
echo"|";
echo sprintf("%28s", "Class Name");
echo"|";
echo sprintf("%4s", "Enb");
echo"|";
echo sprintf("%4s", ... | [
"public",
"function",
"actionIndex",
"(",
")",
"{",
"$",
"extensions",
"=",
"Extension",
"::",
"find",
"(",
")",
"->",
"all",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"extensions",
")",
")",
"{",
"echo",
"\"<empty list>\"",
";",
"}",
"echo",
"\"|... | List all registered extensions.
@return int | [
"List",
"all",
"registered",
"extensions",
"."
] | f6ae90d466ea6f34bba404be0aba03e37ef369ad | https://github.com/rhoone/yii2-rhoone/blob/f6ae90d466ea6f34bba404be0aba03e37ef369ad/controllers/ExtensionController.php#L32-L69 |
33,798 | rhoone/yii2-rhoone | controllers/ExtensionController.php | ExtensionController.actionEnable | public function actionEnable($class)
{
try {
if (Yii::$app->rhoone->ext->enable($class)) {
echo "Enabled.";
} else {
echo "Failed to enable.";
}
} catch (\Exception $ex) {
throw new Exception($ex->getMessage());
... | php | public function actionEnable($class)
{
try {
if (Yii::$app->rhoone->ext->enable($class)) {
echo "Enabled.";
} else {
echo "Failed to enable.";
}
} catch (\Exception $ex) {
throw new Exception($ex->getMessage());
... | [
"public",
"function",
"actionEnable",
"(",
"$",
"class",
")",
"{",
"try",
"{",
"if",
"(",
"Yii",
"::",
"$",
"app",
"->",
"rhoone",
"->",
"ext",
"->",
"enable",
"(",
"$",
"class",
")",
")",
"{",
"echo",
"\"Enabled.\"",
";",
"}",
"else",
"{",
"echo",... | Enable an extension.
@param string $class
@return int | [
"Enable",
"an",
"extension",
"."
] | f6ae90d466ea6f34bba404be0aba03e37ef369ad | https://github.com/rhoone/yii2-rhoone/blob/f6ae90d466ea6f34bba404be0aba03e37ef369ad/controllers/ExtensionController.php#L96-L108 |
33,799 | rhoone/yii2-rhoone | controllers/ExtensionController.php | ExtensionController.actionDisable | public function actionDisable($class)
{
try {
if (Yii::$app->rhoone->ext->disable($class)) {
echo "Disabled.";
} else {
echo "Failed to disable.";
}
} catch (\Exception $ex) {
throw new Exception($ex->getMessage());
... | php | public function actionDisable($class)
{
try {
if (Yii::$app->rhoone->ext->disable($class)) {
echo "Disabled.";
} else {
echo "Failed to disable.";
}
} catch (\Exception $ex) {
throw new Exception($ex->getMessage());
... | [
"public",
"function",
"actionDisable",
"(",
"$",
"class",
")",
"{",
"try",
"{",
"if",
"(",
"Yii",
"::",
"$",
"app",
"->",
"rhoone",
"->",
"ext",
"->",
"disable",
"(",
"$",
"class",
")",
")",
"{",
"echo",
"\"Disabled.\"",
";",
"}",
"else",
"{",
"ech... | Disable an extension.
@param string $class
@return int | [
"Disable",
"an",
"extension",
"."
] | f6ae90d466ea6f34bba404be0aba03e37ef369ad | https://github.com/rhoone/yii2-rhoone/blob/f6ae90d466ea6f34bba404be0aba03e37ef369ad/controllers/ExtensionController.php#L115-L127 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.