chamilo /
chamilo-lms
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | /* For licensing terms, see /license.txt */ |
||
| 3 | |||
| 4 | namespace Chamilo\CourseBundle\Entity; |
||
| 5 | |||
| 6 | use Doctrine\ORM\Mapping as ORM; |
||
| 7 | |||
| 8 | /** |
||
| 9 | * CTool |
||
| 10 | * |
||
| 11 | * @ORM\Table( |
||
| 12 | * name="c_tool", |
||
| 13 | * indexes={ |
||
| 14 | * @ORM\Index(name="course", columns={"c_id"}), |
||
| 15 | * @ORM\Index(name="session_id", columns={"session_id"}) |
||
| 16 | * } |
||
| 17 | * ) |
||
| 18 | * @ORM\Entity |
||
| 19 | */ |
||
| 20 | class CTool |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * @var integer |
||
| 24 | * |
||
| 25 | * @ORM\Column(name="iid", type="integer") |
||
| 26 | * @ORM\Id |
||
| 27 | * @ORM\GeneratedValue |
||
| 28 | */ |
||
| 29 | private $iid; |
||
|
0 ignored issues
–
show
|
|||
| 30 | |||
| 31 | /** |
||
| 32 | * @var integer |
||
| 33 | * |
||
| 34 | * @ORM\Column(name="id", type="integer", nullable=true) |
||
| 35 | */ |
||
| 36 | private $id; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @var integer |
||
| 40 | * |
||
| 41 | * @ORM\Column(name="c_id", type="integer") |
||
| 42 | */ |
||
| 43 | private $cId; |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @var string |
||
| 47 | * |
||
| 48 | * @ORM\Column(name="name", type="string", length=255, nullable=false) |
||
| 49 | */ |
||
| 50 | private $name; |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @var string |
||
| 54 | * |
||
| 55 | * @ORM\Column(name="link", type="string", length=255, nullable=false) |
||
| 56 | */ |
||
| 57 | private $link; |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @var string |
||
| 61 | * |
||
| 62 | * @ORM\Column(name="image", type="string", length=255, nullable=true) |
||
| 63 | */ |
||
| 64 | private $image; |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @var boolean |
||
| 68 | * |
||
| 69 | * @ORM\Column(name="visibility", type="boolean", nullable=true) |
||
| 70 | */ |
||
| 71 | private $visibility; |
||
| 72 | |||
| 73 | /** |
||
| 74 | * @var string |
||
| 75 | * |
||
| 76 | * @ORM\Column(name="admin", type="string", length=255, nullable=true) |
||
| 77 | */ |
||
| 78 | private $admin; |
||
| 79 | |||
| 80 | /** |
||
| 81 | * @var string |
||
| 82 | * |
||
| 83 | * @ORM\Column(name="address", type="string", length=255, nullable=true) |
||
| 84 | */ |
||
| 85 | private $address; |
||
| 86 | |||
| 87 | /** |
||
| 88 | * @var boolean |
||
| 89 | * |
||
| 90 | * @ORM\Column(name="added_tool", type="boolean", nullable=true) |
||
| 91 | */ |
||
| 92 | private $addedTool; |
||
| 93 | |||
| 94 | /** |
||
| 95 | * @var string |
||
| 96 | * |
||
| 97 | * @ORM\Column(name="target", type="string", length=20, nullable=false) |
||
| 98 | */ |
||
| 99 | private $target; |
||
| 100 | |||
| 101 | /** |
||
| 102 | * @var string |
||
| 103 | * |
||
| 104 | * @ORM\Column(name="category", type="string", length=20, nullable=false, options={"default" = "authoring"}) |
||
| 105 | */ |
||
| 106 | private $category; |
||
| 107 | |||
| 108 | /** |
||
| 109 | * @var integer |
||
| 110 | * |
||
| 111 | * @ORM\Column(name="session_id", type="integer", nullable=true) |
||
| 112 | */ |
||
| 113 | private $sessionId; |
||
| 114 | |||
| 115 | /** |
||
| 116 | * @var string |
||
| 117 | * |
||
| 118 | * @ORM\Column(name="description", type="text", nullable=true) |
||
| 119 | */ |
||
| 120 | private $description; |
||
| 121 | |||
| 122 | /** |
||
| 123 | * @var string |
||
| 124 | * |
||
| 125 | * @ORM\Column(name="custom_icon", type="string", length=255, nullable=true) |
||
| 126 | */ |
||
| 127 | private $customIcon; |
||
| 128 | |||
| 129 | /** |
||
| 130 | * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course", inversedBy="tools") |
||
| 131 | * @ORM\JoinColumn(name="c_id", referencedColumnName="id") |
||
| 132 | */ |
||
| 133 | private $course; |
||
| 134 | |||
| 135 | protected $originalImage; |
||
| 136 | |||
| 137 | /** |
||
| 138 | * Constructor |
||
| 139 | */ |
||
| 140 | public function __construct() |
||
| 141 | { |
||
| 142 | // Default values |
||
| 143 | $this->id = 0; |
||
| 144 | $this->sessionId = 0; |
||
| 145 | $this->address = 'squaregrey.gif'; |
||
| 146 | } |
||
| 147 | |||
| 148 | /** |
||
| 149 | * @param Course $course |
||
| 150 | */ |
||
| 151 | public function setCourse($course) |
||
| 152 | { |
||
| 153 | $this->course = $course; |
||
| 154 | } |
||
| 155 | |||
| 156 | /** |
||
| 157 | * @param ClassMetadata $metadata |
||
| 158 | */ |
||
| 159 | public static function loadValidatorMetadata(ClassMetadata $metadata) |
||
| 160 | { |
||
| 161 | $metadata->addPropertyConstraint( |
||
| 162 | 'customIcon', |
||
| 163 | new Assert\File(array('mimeTypes' => array("image/png"))) |
||
| 164 | ); |
||
| 165 | $metadata->addPropertyConstraint( |
||
| 166 | 'customIcon', |
||
| 167 | new Assert\Image(array('maxWidth' => 64, 'minHeight' => 64)) |
||
| 168 | ); |
||
| 169 | $metadata->addPropertyConstraint('cId', new Assert\NotBlank()); |
||
| 170 | } |
||
| 171 | |||
| 172 | /** |
||
| 173 | * @return Course |
||
| 174 | */ |
||
| 175 | public function getCourse() |
||
| 176 | { |
||
| 177 | return $this->course; |
||
| 178 | } |
||
| 179 | |||
| 180 | /** |
||
| 181 | * Set name |
||
| 182 | * |
||
| 183 | * @param string $name |
||
| 184 | * |
||
| 185 | * @return CTool |
||
| 186 | */ |
||
| 187 | public function setName($name) |
||
| 188 | { |
||
| 189 | $this->name = $name; |
||
| 190 | |||
| 191 | return $this; |
||
| 192 | } |
||
| 193 | |||
| 194 | /** |
||
| 195 | * Get name |
||
| 196 | * |
||
| 197 | * @return string |
||
| 198 | */ |
||
| 199 | public function getName() |
||
| 200 | { |
||
| 201 | return $this->name; |
||
| 202 | } |
||
| 203 | |||
| 204 | /** |
||
| 205 | * Set link |
||
| 206 | * |
||
| 207 | * @param string $link |
||
| 208 | * @return CTool |
||
| 209 | */ |
||
| 210 | public function setLink($link) |
||
| 211 | { |
||
| 212 | $this->link = $link; |
||
| 213 | |||
| 214 | return $this; |
||
| 215 | } |
||
| 216 | |||
| 217 | /** |
||
| 218 | * Get link |
||
| 219 | * |
||
| 220 | * @return string |
||
| 221 | */ |
||
| 222 | public function getLink() |
||
| 223 | { |
||
| 224 | return $this->link; |
||
| 225 | } |
||
| 226 | |||
| 227 | /** |
||
| 228 | * Set image |
||
| 229 | * |
||
| 230 | * @param string $image |
||
| 231 | * @return CTool |
||
| 232 | */ |
||
| 233 | public function setImage($image) |
||
| 234 | { |
||
| 235 | $this->image = $image; |
||
| 236 | |||
| 237 | return $this; |
||
| 238 | } |
||
| 239 | |||
| 240 | /** |
||
| 241 | * Get image |
||
| 242 | * |
||
| 243 | * @return string |
||
| 244 | */ |
||
| 245 | public function getImage() |
||
| 246 | { |
||
| 247 | return $this->image; |
||
| 248 | } |
||
| 249 | |||
| 250 | /** |
||
| 251 | * Set visibility |
||
| 252 | * |
||
| 253 | * @param boolean $visibility |
||
| 254 | * @return CTool |
||
| 255 | */ |
||
| 256 | public function setVisibility($visibility) |
||
| 257 | { |
||
| 258 | $this->visibility = $visibility; |
||
| 259 | |||
| 260 | return $this; |
||
| 261 | } |
||
| 262 | |||
| 263 | /** |
||
| 264 | * Get visibility |
||
| 265 | * |
||
| 266 | * @return boolean |
||
| 267 | */ |
||
| 268 | public function getVisibility() |
||
| 269 | { |
||
| 270 | return $this->visibility; |
||
| 271 | } |
||
| 272 | |||
| 273 | /** |
||
| 274 | * Set admin |
||
| 275 | * |
||
| 276 | * @param string $admin |
||
| 277 | * @return CTool |
||
| 278 | */ |
||
| 279 | public function setAdmin($admin) |
||
| 280 | { |
||
| 281 | $this->admin = $admin; |
||
| 282 | |||
| 283 | return $this; |
||
| 284 | } |
||
| 285 | |||
| 286 | /** |
||
| 287 | * Get admin |
||
| 288 | * |
||
| 289 | * @return string |
||
| 290 | */ |
||
| 291 | public function getAdmin() |
||
| 292 | { |
||
| 293 | return $this->admin; |
||
| 294 | } |
||
| 295 | |||
| 296 | /** |
||
| 297 | * Set address |
||
| 298 | * |
||
| 299 | * @param string $address |
||
| 300 | * @return CTool |
||
| 301 | */ |
||
| 302 | public function setAddress($address) |
||
| 303 | { |
||
| 304 | $this->address = $address; |
||
| 305 | |||
| 306 | return $this; |
||
| 307 | } |
||
| 308 | |||
| 309 | /** |
||
| 310 | * Get address |
||
| 311 | * |
||
| 312 | * @return string |
||
| 313 | */ |
||
| 314 | public function getAddress() |
||
| 315 | { |
||
| 316 | return $this->address; |
||
| 317 | } |
||
| 318 | |||
| 319 | /** |
||
| 320 | * Set addedTool |
||
| 321 | * |
||
| 322 | * @param boolean $addedTool |
||
| 323 | * @return CTool |
||
| 324 | */ |
||
| 325 | public function setAddedTool($addedTool) |
||
| 326 | { |
||
| 327 | $this->addedTool = $addedTool; |
||
| 328 | |||
| 329 | return $this; |
||
| 330 | } |
||
| 331 | |||
| 332 | /** |
||
| 333 | * Get addedTool |
||
| 334 | * |
||
| 335 | * @return boolean |
||
| 336 | */ |
||
| 337 | public function getAddedTool() |
||
| 338 | { |
||
| 339 | return $this->addedTool; |
||
| 340 | } |
||
| 341 | |||
| 342 | /** |
||
| 343 | * Set target |
||
| 344 | * |
||
| 345 | * @param string $target |
||
| 346 | * @return CTool |
||
| 347 | */ |
||
| 348 | public function setTarget($target) |
||
| 349 | { |
||
| 350 | $this->target = $target; |
||
| 351 | |||
| 352 | return $this; |
||
| 353 | } |
||
| 354 | |||
| 355 | /** |
||
| 356 | * Get target |
||
| 357 | * |
||
| 358 | * @return string |
||
| 359 | */ |
||
| 360 | public function getTarget() |
||
| 361 | { |
||
| 362 | return $this->target; |
||
| 363 | } |
||
| 364 | |||
| 365 | /** |
||
| 366 | * Set category |
||
| 367 | * |
||
| 368 | * @param string $category |
||
| 369 | * @return CTool |
||
| 370 | */ |
||
| 371 | public function setCategory($category) |
||
| 372 | { |
||
| 373 | $this->category = $category; |
||
| 374 | |||
| 375 | return $this; |
||
| 376 | } |
||
| 377 | |||
| 378 | /** |
||
| 379 | * Get category |
||
| 380 | * |
||
| 381 | * @return string |
||
| 382 | */ |
||
| 383 | public function getCategory() |
||
| 384 | { |
||
| 385 | return $this->category; |
||
| 386 | } |
||
| 387 | |||
| 388 | /** |
||
| 389 | * Set sessionId |
||
| 390 | * |
||
| 391 | * @param integer $sessionId |
||
| 392 | * @return CTool |
||
| 393 | */ |
||
| 394 | public function setSessionId($sessionId) |
||
| 395 | { |
||
| 396 | $this->sessionId = $sessionId; |
||
| 397 | |||
| 398 | return $this; |
||
| 399 | } |
||
| 400 | |||
| 401 | /** |
||
| 402 | * Get sessionId |
||
| 403 | * |
||
| 404 | * @return integer |
||
| 405 | */ |
||
| 406 | public function getSessionId() |
||
| 407 | { |
||
| 408 | return $this->sessionId; |
||
| 409 | } |
||
| 410 | |||
| 411 | /** |
||
| 412 | * Set id |
||
| 413 | * |
||
| 414 | * @param integer $id |
||
| 415 | * @return CTool |
||
| 416 | */ |
||
| 417 | public function setId($id) |
||
| 418 | { |
||
| 419 | $this->id = $id; |
||
| 420 | |||
| 421 | return $this; |
||
| 422 | } |
||
| 423 | |||
| 424 | /** |
||
| 425 | * Get id |
||
| 426 | * |
||
| 427 | * @return integer |
||
| 428 | */ |
||
| 429 | public function getId() |
||
| 430 | { |
||
| 431 | return $this->id; |
||
| 432 | } |
||
| 433 | |||
| 434 | /** |
||
| 435 | * Set cId |
||
| 436 | * |
||
| 437 | * @param integer $cId |
||
| 438 | * @return CTool |
||
| 439 | */ |
||
| 440 | public function setCId($cId) |
||
| 441 | { |
||
| 442 | $this->cId = $cId; |
||
| 443 | |||
| 444 | return $this; |
||
| 445 | } |
||
| 446 | |||
| 447 | /** |
||
| 448 | * Get cId |
||
| 449 | * |
||
| 450 | * @return integer |
||
| 451 | */ |
||
| 452 | public function getCId() |
||
| 453 | { |
||
| 454 | return $this->cId; |
||
| 455 | } |
||
| 456 | |||
| 457 | /** |
||
| 458 | * @return string |
||
| 459 | */ |
||
| 460 | public function getDescription() |
||
| 461 | { |
||
| 462 | return $this->description; |
||
| 463 | } |
||
| 464 | |||
| 465 | /** |
||
| 466 | * @param string $description |
||
| 467 | * @return CTool |
||
| 468 | */ |
||
| 469 | public function setDescription($description) |
||
| 470 | { |
||
| 471 | $this->description = $description; |
||
| 472 | |||
| 473 | return $this; |
||
| 474 | } |
||
| 475 | |||
| 476 | /** |
||
| 477 | * @return string |
||
| 478 | */ |
||
| 479 | public function getCustomIcon() |
||
| 480 | { |
||
| 481 | return $this->customIcon; |
||
| 482 | } |
||
| 483 | |||
| 484 | /** |
||
| 485 | * @param string $customIcon |
||
| 486 | * @return CTool |
||
| 487 | */ |
||
| 488 | public function setCustomIcon($customIcon) |
||
| 489 | { |
||
| 490 | $this->customIcon = $customIcon; |
||
| 491 | |||
| 492 | return $this; |
||
| 493 | } |
||
| 494 | } |
||
| 495 |
This check marks private properties in classes that are never used. Those properties can be removed.