/** * Inserts MList <i>$value</i> at the end of the list. * * @param \MToolkit\Core\MList $value */ public function appendList(MList $value) { if ($value->getType() == $this->getType()) { $this->list = array_merge($this->list, $value->toArray()); return; } foreach ($value as $item) { $this->append($item); } }
/** * Sets the data for the given <i>$section</i> in the header with the specified <i>$orientation</i> to the value supplied.<br /> * Returns true if the header's data was updated; otherwise returns false. * * @param int|string $section * @param int|Orientation $orientation * @param mixed $value * @return false */ public function setHeaderData($section, $orientation, $value) { $toReturn = false; if ($this->data->size() > 0) { return $toReturn; } switch ($orientation) { case Orientation::HORIZONTAL: break; case Orientation::VERTICAL: $fields = array_keys($this->data->toArray()); $values = array_values($this->data->toArray()); $fields[$section] = $value; $this->data = array_combine($fields, $values); $toReturn = true; break; } return $toReturn; }
/** * Returns a list containing all the keys associated with value value in * ascending order. * * @return \MToolkit\Core\MList */ public function getKeys() { $list = new MList(); $list->appendArray(array_keys($this->map)); return $list; }
/** * @return MString */ public function ¤t() { return parent::current(); }
/** * Returns the complete MList<FilePermission> for the file. * * @return \MToolkit\Core\MList */ public function permissions() { $perms = fileperms($this->getAbsoluteFilePath()); $permissions = new MList(); // Owner if ($perms & 0x100) { $permissions->append(FilePermission::READ_OWNER); } if ($perms & 0x80) { $permissions->append(FilePermission::WRITE_OWNER); } if ($perms & 0x40 & !($perms & 0x800)) { $permissions->append(FilePermission::EXE_OWNER); } // Group if ($perms & 0x20) { $permissions->append(FilePermission::READ_GROUP); } if ($perms & 0x10) { $permissions->append(FilePermission::WRITE_GROUP); } if ($perms & 0x8 && !($perms & 0x400)) { $permissions->append(FilePermission::EXE_GROUP); } // World if ($perms & 0x4) { $permissions->append(FilePermission::READ_OTHER); } if ($perms & 0x2) { $permissions->append(FilePermission::WRITE_OTHER); } if ($perms & 0x1 && !($perms & 0x200)) { $permissions->append(FilePermission::EXE_OTHER); } if ($this->isWritable()) { $permissions->append(FilePermission::READ_USER); } if ($this->isReadable()) { $permissions->append(FilePermission::WRITE_USER); } if ($this->isExecutable()) { $permissions->append(FilePermission::EXE_USER); } return $permissions; }
/** * Inserts MList <i>$value</i> at the end of the list. * * @param \MToolkit\Core\MList $value */ public function appendList(MList $value) { for ($i = 0; $i < $value->count(); $i++) { $this->append($value->at($i)); } }
public function append(MDropDownListItem &$item) { $this->keys[$item->getKey()] = $item; $this->value[$item->getValue()] = $item; parent::append($item); }